mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-14 06:32:33 +00:00
RIFF: Support year Accessor
methods in RIFFInfoList
This commit is contained in:
parent
06b3b6dbaf
commit
0c7ea31817
1 changed files with 16 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue