pub struct FileAnalysis {Show 30 fields
pub path: String,
pub source: String,
pub source_version: u32,
pub imported_at: u64,
pub result_at_ns: u64,
pub size_bytes: u64,
pub modified_unix: u64,
pub file_md5: Option<String>,
pub source_data: Option<Json>,
pub md5_state: Option<String>,
pub md5_detail: Option<String>,
pub real_bit_depth: Option<u16>,
pub requant_rate: Option<f64>,
pub fake_stereo: Option<bool>,
pub ext_mismatch: Option<bool>,
pub transcoding: Option<String>,
pub upscaling: Option<bool>,
pub upsampling: Option<bool>,
pub summary: Option<String>,
pub detail: Option<String>,
pub cutoff_hz: Option<f64>,
pub cutoff_ratio: Option<f64>,
pub dr_db: Option<f64>,
pub peak_dbfs: Option<f64>,
pub true_peak_dbtp: Option<f64>,
pub integrated_lufs: Option<f64>,
pub clipped_samples: Option<u64>,
pub clip_events: Option<u64>,
pub clipped: Option<bool>,
pub error: Option<String>,
}Expand description
One file, as FlacCompagnon measured it.
Every measurement is optional: a report may predate a field, omit one, or come from a tool that does not compute it. Nothing here is required for the catalog to work — this is entirely additional.
Fields§
§path: StringAbsolute path of the file this describes.
The primary key is the path, not an identifier into the catalog. Two reasons, and the second is the important one. Identifiers are positions that a scan renumbers, so an identifier would have to be remapped after every scan. And an analysis may perfectly well describe a file the catalog does not hold yet: someone can run the analysis first and build their library afterwards. Keying on the path lets such a record wait, and attach itself the day the file is scanned. A whole-file MD5 can identify a renamed copy when the old path no longer exists.
source: StringTool that produced the measurements, flaccompagnon for now.
source_version: u32Version of the report format, kept so an old import stays readable.
imported_at: u64When it was imported, in seconds since the Unix epoch.
result_at_ns: u64Original report modification time, or in-process measurement completion, in nanoseconds since the Unix epoch. Zero means an older stored result whose date is unknown. Distinct from the audio file’s own mtime.
size_bytes: u64Size the analysed file had, in bytes.
With FileAnalysis::modified_unix, this makes an exact-path or legacy
name-and-size match expire when the file changes. A moved file with a
matching whole-file MD5 can keep its analysis after a timestamp change.
modified_unix: u64Modification date the analysed file had.
file_md5: Option<String>MD5 of the entire file, including tags and artwork, when supplied. Used to identify a moved file without trusting its name or timestamp.
source_data: Option<Json>Complete file entry from the source report, including measurements that
Aède does not interpret yet. It keeps the source path when a matching
file is later moved; FileAnalysis::path is the attached path.
md5_state: Option<String>Verdict on the MD5 stored in STREAMINFO: Match, Mismatch,
NoSignature, Present, Error.
A state, not a hash — the tool compares and reports, it does not
publish the digest. Match is equivalent to a successful flac -t.
md5_detail: Option<String>What went wrong, when the state is an error.
real_bit_depth: Option<u16>Bit depth actually carried, as measured by decoding.
requant_rate: Option<f64>Proportion of samples that show requantisation.
fake_stereo: Option<bool>Both channels hold the same signal.
ext_mismatch: Option<bool>The extension does not match the container found inside.
transcoding: Option<String>The file was made from a lower-resolution source: none, suspected,
detected.
upscaling: Option<bool>A lossless file built from a lossy one.
upsampling: Option<bool>Sample rate raised above what the content justifies.
summary: Option<String>One-word verdict, as the tool words it.
detail: Option<String>The same verdict in a sentence, worth showing as it stands.
cutoff_hz: Option<f64>Frequency where the spectrum stops, in hertz. A cutoff well below half the sample rate is the signature of a lossy ancestry.
cutoff_ratio: Option<f64>That frequency as a fraction of the Nyquist limit.
dr_db: Option<f64>Dynamic range in decibels: the lower, the more compressed the master.
peak_dbfs: Option<f64>Highest sample value, in dBFS.
true_peak_dbtp: Option<f64>True peak, in dBTP — what a converter will actually have to produce.
integrated_lufs: Option<f64>FlacCompagnon’s measured integrated track loudness, in LUFS.
clipped_samples: Option<u64>Samples sitting at full scale.
clip_events: Option<u64>Runs of consecutive clipped samples.
clipped: Option<bool>The tool’s own conclusion on clipping.
error: Option<String>What stopped the analysis of this file, when something did.
Implementations§
Source§impl FileAnalysis
impl FileAnalysis
Sourcepub fn still_applies(&self, size: u64, mtime: u64) -> bool
pub fn still_applies(&self, size: u64, mtime: u64) -> bool
true when the analysis still describes the file as it is now.
Uses the source report’s unchanged size and whole-second modification date. Unlike the scanner’s native cache identity, this contract has no subsecond precision and cannot distinguish all same-second edits.
Sourcepub fn md5_failed(&self) -> bool
pub fn md5_failed(&self) -> bool
true when the decoded audio did not match the file’s own MD5.
Sourcepub fn suspect_encoding(&self) -> bool
pub fn suspect_encoding(&self) -> bool
true when the file is suspected of being built from a lossy source.
Sourcepub fn file_name(&self) -> &str
pub fn file_name(&self) -> &str
Last component of FileAnalysis::path.
With the size, this is what identifies a file that has moved since it was analysed — a name and a byte count together are very nearly unique in a music library.
Trait Implementations§
Source§impl Clone for FileAnalysis
impl Clone for FileAnalysis
Source§fn clone(&self) -> FileAnalysis
fn clone(&self) -> FileAnalysis
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more