Add sidecar metadata files
Some checks failed
CI / Typos (push) Successful in 24s
CI / Clippy (push) Failing after 59s
CI / Build and test (push) Failing after 1m7s

This commit is contained in:
2026-03-05 22:02:38 -08:00
parent a9e402bc83
commit 16f1e38087
8 changed files with 122 additions and 12 deletions

View File

@@ -1,14 +1,17 @@
mod flac;
use pile_config::Label;
use std::{collections::HashMap, rc::Rc};
mod flac;
pub use flac::*;
mod fs;
pub use fs::*;
mod sidecar;
pub use sidecar::*;
mod map;
pub use map::*;
use pile_config::Label;
/// An attachment that extracts metadata from an [Item].
///
@@ -46,6 +49,10 @@ impl<'a> MetaExtractor<'a, crate::FileItem> {
Label::new("fs").unwrap(),
crate::PileValue::Extractor(Rc::new(FsExtractor::new(item))),
),
(
Label::new("sidecar").unwrap(),
crate::PileValue::Extractor(Rc::new(SidecarExtractor::new(item))),
),
]),
};
@@ -63,6 +70,10 @@ impl Extractor<crate::FileItem> for MetaExtractor<'_, crate::FileItem> {
#[expect(clippy::unwrap_used)]
fn fields(&self) -> Result<Vec<Label>, std::io::Error> {
return Ok(vec![Label::new("flac").unwrap(), Label::new("fs").unwrap()]);
return Ok(vec![
Label::new("flac").unwrap(),
Label::new("fs").unwrap(),
Label::new("sidecar").unwrap(),
]);
}
}