fix incorrect album fetching

This commit is contained in:
geoffrey45
2021-12-28 10:08:31 +03:00
parent 49947a22b2
commit c49e1e48f1
7 changed files with 28 additions and 13 deletions
+8 -4
View File
@@ -351,12 +351,16 @@ def getAlbums():
return {'albums': albums}
@bp.route('/albums/<album>')
def getAlbumSongs(album: str):
album = urllib.parse.unquote(album)
songs = all_songs_instance.find_songs_by_album(album)
@bp.route('/albums/<query>')
def getAlbumSongs(query: str):
album = query.split('::')[0]
artist = query.split('::')[1]
songs = all_songs_instance.find_songs_by_album(album, artist)
songs_array = convert_to_json(songs)
print(artist)
for song in songs_array:
song['artists'] = song['artists'].split(', ')
song['filepath'] = song['filepath'].replace(home_dir, '')