fix duplicate albums with date = 0

This commit is contained in:
mungai-njoroge committed 2023-06-26 13:17:24 +03:00
1 parent dbfa395207
commit 1cf5d38a96
3 files changed
+11 -5

No files matched your search

+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]: