From 1fb2f34955cd4156a3eee61d0fa50881b03c2693 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 28 Apr 2026 10:39:52 -0700 Subject: [PATCH] PR4h fixup: restore strict 1:1 in master.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three drifts caught in line-by-line review against original — all reverted so the lifted body is now byte-identical to the web_server.py original (after deps.X → global X normalization): 1. `import traceback` was hoisted to module-level imports. Original imports it inline inside the except block. Moved back to inline (same behavior, but strict location parity). 2. Trailing whitespace on the blank line after analysis_results.append. 3. Trailing whitespace on the blank line inside the wishlist except handler. Diff against original now produces ZERO differences. Tests still 21/21 passing, ruff clean. --- core/downloads/master.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/downloads/master.py b/core/downloads/master.py index 9a449b9c..e5c081d4 100644 --- a/core/downloads/master.py +++ b/core/downloads/master.py @@ -29,7 +29,6 @@ import json import logging import re import time -import traceback import uuid from dataclasses import dataclass from typing import Any, Callable @@ -231,7 +230,7 @@ def run_full_missing_tracks_process(batch_id, playlist_id, tracks_json, deps: Ma analysis_results.append({ 'track_index': track_index, 'track': track_data, 'found': found, 'confidence': confidence }) - + # WISHLIST REMOVAL: If track is found in database, check if it should be removed from wishlist if found and confidence >= 0.7: try: @@ -553,7 +552,7 @@ def run_full_missing_tracks_process(batch_id, playlist_id, tracks_json, deps: Ma spotify_data = json.loads(spotify_data) except: spotify_data = {} - + if not spotify_data: spotify_data = {} @@ -626,6 +625,7 @@ def run_full_missing_tracks_process(batch_id, playlist_id, tracks_json, deps: Ma except Exception as e: logger.error(f"Master worker for batch {batch_id} failed: {e}") + import traceback traceback.print_exc() is_auto_batch = False