cleanup/minor
This commit is contained in:
@ -3,8 +3,8 @@ import traceback
|
||||
from typing import Optional, Union
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import JSONResponse
|
||||
from .constructors import ValidArtistSearchRequest, ValidAlbumDetailRequest,\
|
||||
ValidTrackInfoRequest, LastFMException
|
||||
from .constructors import (ValidArtistSearchRequest, ValidAlbumDetailRequest,
|
||||
ValidTrackInfoRequest, LastFMException)
|
||||
|
||||
class LastFM(FastAPI):
|
||||
"""Last.FM Endpoints"""
|
||||
@ -41,7 +41,8 @@ class LastFM(FastAPI):
|
||||
})
|
||||
|
||||
artist_result = await self.lastfm.search_artist(artist=artist)
|
||||
if not artist_result or "err" in artist_result.keys():
|
||||
if not artist_result or not artist_result.get('bio')\
|
||||
or "err" in artist_result.keys():
|
||||
return JSONResponse(status_code=500, content={
|
||||
'err': True,
|
||||
'errorText': 'Search failed (no results?)',
|
||||
|
Reference in New Issue
Block a user