RIFF: Support year Accessor methods in RIFFInfoList

This commit is contained in:
Serial 2023-01-14 20:22:19 -05:00 committed by Alex
parent 06b3b6dbaf
commit 0c7ea31817

View file

@ -123,6 +123,22 @@ impl Accessor for RIFFInfoList {
fn remove_track_total(&mut self) {
self.remove("IFRM");
}
fn year(&self) -> Option<u32> {
if let Some(item) = self.get("ICRD") {
return item.chars().take(4).collect::<String>().parse::<u32>().ok();
}
None
}
fn set_year(&mut self, value: u32) {
self.insert(String::from("ICRD"), value.to_string());
}
fn remove_year(&mut self) {
self.remove("ICRD");
}
}
impl IntoIterator for RIFFInfoList {