show artist decade in genres

+ assign default artist separators if db is empty
+ add instrumental to album version
+ check if album is a single by checking og_title and current title
+ hard code juice wrld artist name in model
+ set album aritst to first artist if track has no album artist
+ rewrite get_base_album_title regex to use existing album versions
+ misc
This commit is contained in:
mungai-njoroge
2023-09-04 11:01:03 +03:00
parent 5ff3e5d28a
commit 83bbe69550
9 changed files with 93 additions and 54 deletions
+6 -12
View File
@@ -101,10 +101,11 @@ class AlbumStore:
"""
Returns an album by its hash.
"""
try:
return [a for a in cls.albums if a.albumhash == albumhash][0]
except IndexError:
return None
for album in cls.albums:
if album.albumhash == albumhash:
return album
return None
@classmethod
def get_albums_by_hashes(cls, albumhashes: list[str]) -> list[Album]:
@@ -132,14 +133,7 @@ class AlbumStore:
"""
Count albums for the given artisthash.
"""
albumartists = [a.albumartists for a in cls.albums]
artisthashes = []
for artist in albumartists:
artisthashes.extend([a.artisthash for a in artist]) # type: ignore
master_string = "-".join(artisthashes)
master_string = "-".join(a.albumartists_hashes for a in cls.albums)
return master_string.count(artisthash)
@classmethod