mirror of
https://github.com/agersant/polaris
synced 2024-09-20 13:41:54 +00:00
year one-liner for mp4 metadata
This commit is contained in:
parent
f0fc9e8fba
commit
337a4020fe
1 changed files with 1 additions and 2 deletions
|
@ -225,8 +225,7 @@ fn read_mp4(path: &Path) -> Result<SongTags> {
|
||||||
tags.duration = tag.duration().map(|v| v as u32);
|
tags.duration = tag.duration().map(|v| v as u32);
|
||||||
tags.disc_number = tag.disk_number().0.and_then(|d| Some(d as u32));
|
tags.disc_number = tag.disk_number().0.and_then(|d| Some(d as u32));
|
||||||
tags.track_number = tag.track_number().0.and_then(|d| Some(d as u32));
|
tags.track_number = tag.track_number().0.and_then(|d| Some(d as u32));
|
||||||
let year = tag.year().and_then(|v| Some(v.parse::<i32>().ok()));
|
tags.year = tag.year().and_then(|v| v.parse::<i32>().ok());
|
||||||
tags.year = match year { None => None, Some(year) => year};
|
|
||||||
|
|
||||||
Ok(tags)
|
Ok(tags)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue