sort albums in get_artist_albums route

This commit is contained in:
geoffrey45
2023-05-08 16:19:38 +03:00
parent 45bf7570a3
commit b9f0204225
3 changed files with 11 additions and 11 deletions
+2 -5
View File
@@ -108,14 +108,14 @@ def get_artist_albums():
albumartists: str = data["albumartists"]
limit: int = data.get("limit")
exclude: str = data.get("exclude")
base_title: str = data.get("base_title")
albumartists: list[str] = albumartists.split(",")
albums = [
{
"artisthash": a,
"albums": AlbumStore.get_albums_by_albumartist(a, limit, exclude=exclude),
"albums": AlbumStore.get_albums_by_albumartist(a, limit, exclude=base_title),
}
for a in albumartists
]
@@ -141,7 +141,6 @@ def get_album_versions():
artisthash: str = data['artisthash']
albums = AlbumStore.get_albums_by_artisthash(artisthash)
print(base_title, artisthash)
albums = [
a for a in albums
@@ -149,8 +148,6 @@ def get_album_versions():
create_hash(a.base_title) == create_hash(base_title) and create_hash(og_album_title) != create_hash(a.og_title)
]
print(albums)
return {
"data": albums
}