diff --git a/metadata/src/audio/item.rs b/metadata/src/audio/item.rs index b2789008..656d07cd 100644 --- a/metadata/src/audio/item.rs +++ b/metadata/src/audio/item.rs @@ -47,6 +47,7 @@ pub enum UniqueFields { Track { artists: ArtistsWithRole, album: String, + album_date: Date, album_artists: Vec, popularity: u8, number: u32, @@ -83,6 +84,8 @@ impl AudioItem { let uri = track_id.to_uri()?; let album = track.album.name; + let album_date = track.album.date; + let album_artists = track .album .artists @@ -116,6 +119,7 @@ impl AudioItem { let unique_fields = UniqueFields::Track { artists: track.artists_with_role, album, + album_date, album_artists, popularity, number, diff --git a/src/player_event_handler.rs b/src/player_event_handler.rs index 3d0a47df..400241ce 100644 --- a/src/player_event_handler.rs +++ b/src/player_event_handler.rs @@ -54,6 +54,7 @@ impl EventHandler { UniqueFields::Track { artists, album, + album_date, album_artists, popularity, number, @@ -72,6 +73,10 @@ impl EventHandler { env_vars .insert("ALBUM_ARTISTS", album_artists.join("\n")); env_vars.insert("ALBUM", album); + env_vars.insert( + "ALBUM_DATE", + album_date.unix_timestamp().to_string(), + ); env_vars.insert("POPULARITY", popularity.to_string()); env_vars.insert("NUMBER", number.to_string()); env_vars.insert("DISC_NUMBER", disc_number.to_string());