From 836bbe4dc5265d2faeff59efb795d8f164ff9d78 Mon Sep 17 00:00:00 2001 From: mungai-njoroge Date: Fri, 3 Nov 2023 17:17:10 +0300 Subject: [PATCH] Fix error codes for missing album and lyrics --- app/api/album.py | 4 ++-- app/api/lyrics.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/album.py b/app/api/album.py index b0bf059b..c9f1815f 100644 --- a/app/api/album.py +++ b/app/api/album.py @@ -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() diff --git a/app/api/lyrics.py b/app/api/lyrics.py index 7253279f..2a00be91 100644 --- a/app/api/lyrics.py +++ b/app/api/lyrics.py @@ -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