fix duplicate albums with date = 0

This commit is contained in:
mungai-njoroge
2023-06-26 13:17:24 +03:00
parent dbfa395207
commit 1cf5d38a96
3 changed files with 11 additions and 5 deletions
+5 -2
View File
@@ -61,8 +61,11 @@ class ArtistStore:
Returns an artist by its hash.P
"""
artists = sorted(cls.artists, key=lambda x: x.artisthash)
artist = UseBisection(artists, "artisthash", [artisthash])()[0]
return artist
try:
artist = UseBisection(artists, "artisthash", [artisthash])()[0]
return artist
except IndexError:
return None
@classmethod
def get_artists_by_hashes(cls, artisthashes: list[str]) -> list[Artist]: