Handle invalid lookup URIs
parent
fefcdf3134
commit
63cd47d377
|
@ -375,9 +375,14 @@ class FunkwhaleLibraryProvider(backend.LibraryProvider):
|
|||
"artist": lambda id: client.list_tracks({"artist": id})["results"],
|
||||
}
|
||||
|
||||
type, id = parse_uri(uri)
|
||||
payload = config[type](id)
|
||||
return [convert_to_track(row, cache=self.cache) for row in payload]
|
||||
try:
|
||||
type, id = parse_uri(uri)
|
||||
except (IndexError, ValueError):
|
||||
logger.info(f"Lookup failed: invalid uri '{uri}'")
|
||||
return []
|
||||
else:
|
||||
payload = config[type](id)
|
||||
return [convert_to_track(row, cache=self.cache) for row in payload]
|
||||
|
||||
|
||||
def parse_uri(uri):
|
||||
|
|
Loading…
Reference in New Issue