Fixed a bug where artists with no album could sneak into collection
This commit is contained in:
parent
2b81355f6d
commit
6bd0c25d7d
1 changed files with 6 additions and 2 deletions
|
@ -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,
|
||||
}),
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue