Fix missing get_db_connection import in queue_manager (silent NameError causes wrongful blacklisting)#426
Open
Ele-CO wants to merge 1 commit into
Conversation
queues/queue_manager.py calls get_db_connection() in the new-item ghostlist/blacklist pre-check (~line 1115) but never imports it at module level. Because the call sits inside a try/except, the resulting NameError is swallowed: the pre-check fails silently and items can be wrongly blacklisted instead of falling back to a 1080p result. Add the missing module-level import, matching the existing `from database.core import ...` import style already used across the codebase (e.g. database_reading.py, database_writing.py). One-line, behavior-only-corrective change; no other logic touched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
queues/queue_manager.pycallsget_db_connection()in the new-item ghostlist/blacklist pre-check (around line 1115), butget_db_connectionis never imported at module level (nor locally in that function).Because the call is inside a
try/except, the resultingNameErroris swallowed. The pre-check silently fails, which can lead to items being wrongly blacklisted instead of falling back to a 1080p result. The symptom is hard to spot because there's no visible error.Fix
Add the missing module-level import, matching the existing import style already used throughout the codebase (e.g.
database/database_reading.py,database/database_writing.pyboth dofrom database.core import get_db_connection).+from database.core import get_db_connection from database.database_writing import update_media_item_state, add_media_item from database.database_reading import get_media_item_by_id, get_item_count_by_state from database.collected_items import add_to_collected_notificationsThis is a one-line, behavior-correcting change. No other logic is touched.
🤖 Generated with Claude Code