mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Simplifies subsonicupdate JSON handling and updated changelog
This commit is contained in:
parent
a81456a12c
commit
51be7be0b0
2 changed files with 6 additions and 6 deletions
|
|
@ -138,6 +138,7 @@ class SubsonicUpdate(BeetsPlugin):
|
|||
params=payload,
|
||||
timeout=10,
|
||||
)
|
||||
response.raise_for_status()
|
||||
try:
|
||||
json = response.json()
|
||||
except ValueError:
|
||||
|
|
@ -145,15 +146,14 @@ class SubsonicUpdate(BeetsPlugin):
|
|||
"Invalid JSON from Subsonic: {}", response.text[:200]
|
||||
)
|
||||
return
|
||||
resp = json.get("subsonic-response")
|
||||
if not resp:
|
||||
if not (resp := json.get("subsonic-response")):
|
||||
self._log.error("Missing 'subsonic-response' field: {}", json)
|
||||
return
|
||||
status = resp.get("status")
|
||||
if response.status_code == 200 and status == "ok":
|
||||
if status == "ok":
|
||||
count = resp.get("scanStatus", {}).get("count", 0)
|
||||
self._log.info("Updating Subsonic; scanning {} tracks", count)
|
||||
elif response.status_code == 200 and status == "failed":
|
||||
elif status == "failed":
|
||||
msg = resp.get("error", {}).get("message", "Unknown error")
|
||||
self._log.error("Error: {}", msg)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ New features:
|
|||
resolve differences in metadata source styles.
|
||||
|
||||
Bug fixes:
|
||||
- :doc:`plugins/subsonicupdate`: Improve error messages when the Subsonic server
|
||||
is unavailable or returns invalid/missing JSON. Previously, failures were
|
||||
- :doc:`plugins/subsonicupdate`: Improve error messages when the Subsonic server
|
||||
is unavailable or returns invalid or missing JSON. Previously, failures were
|
||||
cryptic (e.g., "Expecting value: line 1 column 1 (char 0)"). :bug:`5635`
|
||||
- :doc:`plugins/inline`: Fix recursion error when an inline field definition
|
||||
shadows a built-in item field (e.g., redefining ``track_no``). Inline
|
||||
|
|
|
|||
Loading…
Reference in a new issue