fix(server): use .get() for title/artist in perform_url_fetch result
Defensive access guards against download_single returning ok=True without title/artist keys, avoiding a KeyError in the job worker. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -94,5 +94,5 @@ def perform_url_fetch(url: str, quality: str, root: str) -> dict:
|
|||||||
info = mf.download_single(url, root, quality, False)
|
info = mf.download_single(url, root, quality, False)
|
||||||
if not info.get("ok"):
|
if not info.get("ok"):
|
||||||
raise RuntimeError("Download failed.")
|
raise RuntimeError("Download failed.")
|
||||||
return {"kind": "track", "title": info["title"], "artist": info["artist"],
|
return {"kind": "track", "title": info.get("title", ""), "artist": info.get("artist", ""),
|
||||||
"ok": 1, "total": 1, "path": None, "lidarr_album_id": None}
|
"ok": 1, "total": 1, "path": None, "lidarr_album_id": None}
|
||||||
|
|||||||
Reference in New Issue
Block a user