Fixed a bug where artists with no album could sneak into collection

This commit is contained in:
Antoine Gersant 2024-09-17 22:27:05 -07:00
parent 2b81355f6d
commit 6bd0c25d7d

View file

@ -81,15 +81,19 @@ pub struct SongKey {
impl Song {
pub fn album_key(&self) -> Option<AlbumKey> {
let album_artists = match self.album_artists.is_empty() {
let main_artists = match self.album_artists.is_empty() {
true => &self.artists,
false => &self.album_artists,
};
if main_artists.is_empty() {
return None;
}
match self.album {
None => None,
Some(name) => Some(AlbumKey {
artists: album_artists.iter().cloned().collect(),
artists: main_artists.iter().cloned().collect(),
name,
}),
}