From 5378b726eee9ba8bedc52773ccb619a2072eecfb Mon Sep 17 00:00:00 2001
From: Broque Thomas <26755000+Nezreka@users.noreply.github.com>
Date: Tue, 26 May 2026 17:52:54 -0700
Subject: [PATCH] Debug logging on LB rolling-mirror bulk ensure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Temporary instrumentation — bulk ensure path silently created
only one rolling mirror despite multiple known series members
existing in the LB cache. Promotes the bulk-ensure summary +
per-title match notes to INFO level so the next refresh
surfaces in the server log:
- ``[LB Rolling] Bulk ensure walking N cached titles for profile X``
- ``[LB Rolling] Title matched series:
-> ``
- ``[LB Rolling] Bulk ensure done — M/N titles matched a series``
Plus the outer ``except`` is bumped from debug to warning so a
genuine SELECT failure stops being invisible.
Once the root cause is identified the noise can drop back to
debug.
---
core/listenbrainz_manager.py | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/core/listenbrainz_manager.py b/core/listenbrainz_manager.py
index ddae7ae8..65b06da6 100644
--- a/core/listenbrainz_manager.py
+++ b/core/listenbrainz_manager.py
@@ -245,10 +245,24 @@ class ListenBrainzManager:
(self.profile_id,),
)
titles = [row[0] for row in cursor.fetchall() if row[0]]
+ logger.info(
+ f"[LB Rolling] Bulk ensure walking {len(titles)} cached titles for profile {self.profile_id}"
+ )
+ from core.playlists.lb_series import detect_series
+ matched = 0
for title in titles:
+ m = detect_series(title)
+ if m is not None:
+ matched += 1
+ logger.info(
+ f"[LB Rolling] Title matched series: {title!r} -> {m.series_id}"
+ )
self._ensure_rolling_series_mirror(cursor, title)
+ logger.info(
+ f"[LB Rolling] Bulk ensure done — {matched}/{len(titles)} titles matched a series"
+ )
except Exception as exc:
- logger.debug(f"Bulk rolling-mirror ensure skipped: {exc}")
+ logger.warning(f"Bulk rolling-mirror ensure skipped: {exc}")
def _ensure_rolling_series_mirror(self, cursor, playlist_title: str):
"""Upsert a placeholder ``mirrored_playlists`` row for the