Lint: log instead of bare except-pass in two best-effort paths (ruff S110)
The album_tracks cache store (deezer_client) and the mutagen audio-length probe (hifi_client) swallowed errors with try/except/pass. ruff S110 (selected by the project) flagged them — they were the only 2 lint errors app-wide. Log at debug instead. ruff check . now passes clean.
This commit is contained in:
parent
458658de86
commit
2a7259b296
2 changed files with 4 additions and 4 deletions
|
|
@ -148,8 +148,8 @@ def resolve_album_track_positions(session, base_url, album_ids, cache=None, slee
|
||||||
if cache and at_list is not None:
|
if cache and at_list is not None:
|
||||||
try:
|
try:
|
||||||
cache.store_entity('deezer', 'album_tracks', aid, {'data': at_list})
|
cache.store_entity('deezer', 'album_tracks', aid, {'data': at_list})
|
||||||
except Exception: # noqa: BLE001
|
except Exception as _cache_err: # noqa: BLE001
|
||||||
pass
|
logger.debug("album_tracks cache store failed for %s: %s", aid, _cache_err)
|
||||||
except Exception: # noqa: BLE001 - never let metadata resolution break the fetch
|
except Exception: # noqa: BLE001 - never let metadata resolution break the fetch
|
||||||
at_list = None
|
at_list = None
|
||||||
for at in (at_list or []):
|
for at in (at_list or []):
|
||||||
|
|
|
||||||
|
|
@ -801,8 +801,8 @@ class HiFiClient(DownloadSourcePlugin):
|
||||||
info = getattr(mf, 'info', None) if mf is not None else None
|
info = getattr(mf, 'info', None) if mf is not None else None
|
||||||
if info is not None:
|
if info is not None:
|
||||||
return float(getattr(info, 'length', 0) or 0)
|
return float(getattr(info, 'length', 0) or 0)
|
||||||
except Exception:
|
except Exception as _probe_err: # noqa: BLE001
|
||||||
pass
|
logger.debug("mutagen audio-length probe failed for %s: %s", path, _probe_err)
|
||||||
return 0.0
|
return 0.0
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue