From 2ecbd8badca84b6036b2b6d232c796c5bf0654e6 Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Thu, 18 Jun 2026 12:09:22 -0700 Subject: [PATCH] lint: log the skipped album source-id lookup instead of a bare try/except/pass (ruff S110) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Deezer missing-column fallthrough in find_existing_soulsync_album_id used a bare 'except: pass', which ruff flags as S110. Log it at debug instead — same fail-safe behaviour, no swallowed-exception lint warning. --- core/imports/album_grouping.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/imports/album_grouping.py b/core/imports/album_grouping.py index f216e271..be43c108 100644 --- a/core/imports/album_grouping.py +++ b/core/imports/album_grouping.py @@ -25,6 +25,10 @@ from __future__ import annotations from typing import Any, Optional +from utils.logging_config import get_logger + +logger = get_logger("imports.album_grouping") + # Album source-id columns this grouping may key on. An allowlist (not arbitrary # interpolation) — the column name IS spliced into SQL, so it must be a known, # trusted identifier. Mirrors get_library_source_id_columns()' 'album' values. @@ -78,12 +82,12 @@ def find_existing_soulsync_album_id( row = cursor.fetchone() if row: return row[0] - except Exception: + except Exception as exc: # That source has no dedicated album column on this DB (e.g. Deezer # doesn't split per-entity id columns) — fall through to the name # match rather than break the import. Mirrors the guarded source-id # UPDATE the caller already does on insert. - pass + logger.debug("album source-id lookup skipped (%s): %s", album_source_col, exc) cursor.execute( "SELECT id FROM albums WHERE title COLLATE NOCASE = ? AND artist_id = ? "