Fix error codes for missing album and lyrics

This commit is contained in:
mungai-njoroge
2023-11-03 17:17:10 +03:00
parent 72947203fa
commit 836bbe4dc5
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -44,7 +44,7 @@ def get_album_tracks_and_info():
album = AlbumStore.get_album_by_hash(albumhash)
if album is None:
return error_msg, 204
return error_msg, 404
tracks = TrackStore.get_tracks_by_albumhash(albumhash)
@@ -52,7 +52,7 @@ def get_album_tracks_and_info():
return error_msg, 404
if len(tracks) == 0:
return error_msg, 204
return error_msg, 404
def get_album_genres(tracks: list[Track]):
genres = set()
+1 -1
View File
@@ -33,7 +33,7 @@ def send_lyrics():
lyrics, is_synced, copyright = get_lyrics_from_tags(filepath)
if not lyrics:
return {"error": "No lyrics found"}, 204
return {"error": "No lyrics found"}, 404
return {"lyrics": lyrics, "synced": is_synced, "copyright": copyright}, 200