Commit 63cd47d3 authored by Erin's avatar Erin
Browse files

Handle invalid lookup URIs

parent fefcdf31
......@@ -375,7 +375,12 @@ class FunkwhaleLibraryProvider(backend.LibraryProvider):
"artist": lambda id: client.list_tracks({"artist": id})["results"],
}
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]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment