mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
fix incorrect album fetching
This commit is contained in:
+8
-4
@@ -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, '')
|
||||
|
||||
Reference in New Issue
Block a user