From 2a7259b29633cb5aa17131a515c8d972f9364876 Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Sun, 21 Jun 2026 22:47:11 -0700 Subject: [PATCH] Lint: log instead of bare except-pass in two best-effort paths (ruff S110) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- core/deezer_client.py | 4 ++-- core/hifi_client.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/deezer_client.py b/core/deezer_client.py index c6957bea..64ca5141 100644 --- a/core/deezer_client.py +++ b/core/deezer_client.py @@ -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: try: cache.store_entity('deezer', 'album_tracks', aid, {'data': at_list}) - except Exception: # noqa: BLE001 - pass + except Exception as _cache_err: # noqa: BLE001 + logger.debug("album_tracks cache store failed for %s: %s", aid, _cache_err) except Exception: # noqa: BLE001 - never let metadata resolution break the fetch at_list = None for at in (at_list or []): diff --git a/core/hifi_client.py b/core/hifi_client.py index f748f13e..0b380132 100644 --- a/core/hifi_client.py +++ b/core/hifi_client.py @@ -801,8 +801,8 @@ class HiFiClient(DownloadSourcePlugin): info = getattr(mf, 'info', None) if mf is not None else None if info is not None: return float(getattr(info, 'length', 0) or 0) - except Exception: - pass + except Exception as _probe_err: # noqa: BLE001 + logger.debug("mutagen audio-length probe failed for %s: %s", path, _probe_err) return 0.0 @staticmethod