Fix songs that incorrectly tag missing year as year 0

This commit is contained in:
Agatha Lovelace 2022-10-06 15:13:09 +02:00
parent bb9d2ce11f
commit c7b3b3c745
Signed by: sorceress
GPG Key ID: 11BBCFC65FC9F401
1 changed files with 4 additions and 1 deletions

View File

@ -100,7 +100,10 @@ pub async fn index_source(source: Source, mode: IndexMode, db: &DatabaseConnecti
album: Set(tags.and_then(|t| t.album()).map(|t| t.to_string())),
genres: Set(tags.and_then(|t| t.genre()).map(|t| t.to_string())),
track: Set(tags.and_then(|t| t.track()).map(|t| t as i32)),
year: Set(tags.and_then(|t| t.year()).map(|t| t as i32)),
year: Set(tags
.and_then(|t| t.year())
.map(|t| if t == 0 { None } else { Some(t as i32) })
.flatten()),
duration: Set(properties
.duration()
.as_millis()