Skip to content

Commit

Permalink
fix, server, get playlist: returning 404 even for existing playlists
Browse files Browse the repository at this point in the history
  • Loading branch information
dxstiny committed Oct 31, 2023
1 parent b927f8e commit 4e07a6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/server/handler/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ async def removeSong(self, request: web.Request) -> web.Response:
async def getPlaylist(self, payload: Dict[str, Any]) -> web.Response:
"""post(/api/playlists/{id})"""
id_: str = payload["id"]
if playlist := self._playlistManager.get(id_):
playlist = self._playlistManager.get(id_)
if playlist is not None:
return web.json_response(playlist.toDict())
return web.HTTPNotFound()

Expand Down
1 change: 0 additions & 1 deletion src/server/test.main.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def _second() -> None:

# get our playlist
with requests.get(f"http://localhost:1234/api/playlists/{id_}", timeout = 10) as res:
print(res.text)
playlist = JDict(res.json())
logger.info(res.status_code)
logger.info(playlist)
Expand Down

0 comments on commit 4e07a6a

Please sign in to comment.