From ab9064d3f6d21625f4e75a53d71fda1b5119a078 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 14 Apr 2026 08:04:15 -0700 Subject: [PATCH] Fix import pipeline not placing multi-disc albums into Disc N/ subfolders import_album_process never computed total_discs, so spotify_album.total_discs always defaulted to 1 in _build_final_path_for_track. Now pre-computes total_discs from the matched tracks before the per-track loop. --- web_server.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web_server.py b/web_server.py index 977c08d8..256b6b0f 100644 --- a/web_server.py +++ b/web_server.py @@ -51901,6 +51901,12 @@ def import_album_process(): except Exception: pass + # Compute total_discs across all matched tracks for multi-disc subfolder support + total_discs = max( + (m['spotify_track'].get('disc_number', 1) for m in matches if m.get('spotify_track')), + default=1 + ) + for match in matches: staging_file = match.get('staging_file') spotify_track = match.get('spotify_track') @@ -51929,6 +51935,7 @@ def import_album_process(): 'name': album_name, 'release_date': album.get('release_date', ''), 'total_tracks': album.get('total_tracks', len(matches)), + 'total_discs': total_discs, 'image_url': album.get('image_url', '') }, 'track_info': {