diff --git a/core/repair_worker.py b/core/repair_worker.py index 4b7a0402..4002f50c 100644 --- a/core/repair_worker.py +++ b/core/repair_worker.py @@ -1615,9 +1615,13 @@ class RepairWorker: aid_artist.strip() or 'unknown' ) new_artist_id = f"artist_local_{safe_artist_name}_{uuid.uuid4().hex[:8]}" + # Include server_source to match the active media server context + active_server = 'plex' + if self._config_manager: + active_server = self._config_manager.get('active_media_server', 'plex') cursor.execute( - "INSERT INTO artists (id, name) VALUES (?, ?)", - (new_artist_id, aid_artist), + "INSERT INTO artists (id, name, server_source) VALUES (?, ?, ?)", + (new_artist_id, aid_artist, active_server), ) cursor.execute("UPDATE tracks SET artist_id = ? WHERE id = ?", (new_artist_id, track_id)) @@ -1626,6 +1630,20 @@ class RepairWorker: except Exception as e: return {'success': False, 'error': f'DB update failed: {e}'} + # Write corrected tags to the actual audio file + if file_path: + resolved = _resolve_file_path(file_path, self.transfer_folder) + if resolved and os.path.exists(resolved): + try: + from core.tag_writer import write_tags_to_file + tag_updates = {'title': aid_title} + if aid_artist: + tag_updates['artist_name'] = aid_artist + write_tags_to_file(resolved, tag_updates) + logger.info("Wrote corrected tags to file: %s", resolved) + except Exception as tag_err: + logger.warning("Could not write tags to file %s: %s", resolved, tag_err) + return {'success': True, 'action': 'retagged', 'message': f'Updated to: "{aid_title}" by {aid_artist}'} diff --git a/web_server.py b/web_server.py index e6739411..c3fbe953 100644 --- a/web_server.py +++ b/web_server.py @@ -22529,6 +22529,7 @@ def get_version_info(): "• Reject Qobuz 30-second sample/preview downloads", "• Fix library page crash on All filter — non-string soul_id broke card rendering", "• Auto Wing It fallback for failed discovery — unmatched tracks download via Soulseek with raw metadata", + "• Fix AcoustID retag not writing corrected tags to audio file", "• Fix wishlist albums cycle stuck at 1 concurrent worker instead of configured value", "• Fix downloads badge dropping to 300 after opening Downloads page", "• Fix server playlist Find & Add inserting at wrong position on Plex", diff --git a/webui/static/helper.js b/webui/static/helper.js index f4960fd6..3cef1720 100644 --- a/webui/static/helper.js +++ b/webui/static/helper.js @@ -3603,6 +3603,7 @@ const WHATS_NEW = { // --- April 19, 2026 --- { date: 'April 19, 2026' }, { title: 'Fix Wishlist Albums Cycle Stuck at 1 Concurrent', desc: 'Auto-wishlist processing during the "albums" cycle was limited to 1 concurrent download even with higher configured settings. The max_concurrent=1 restriction is only needed for Soulseek folder-based album grabs, not individual wishlist track downloads. Albums cycle now uses the configured concurrency like singles' }, + { title: 'Fix AcoustID Retag Not Writing to File', desc: 'The AcoustID mismatch "Retag" fix action was only updating the database record without writing corrected tags to the actual audio file. Now writes title and artist tags to the file using Mutagen after updating the DB' }, { title: 'Fix Downloads Badge Dropping to 300', desc: 'Downloads nav badge showed the correct count from WebSocket but dropped to max 300 after opening the Downloads page because it recounted from a truncated local array. Badge now stays accurate from the server-side count' }, { title: 'Fix Server Playlist Find & Add Position', desc: 'When using "Find & add" on server playlists with Plex, the track was always appended to the end instead of inserted at the correct position. Now moves the track to the right slot after adding' }, { title: 'Smarter Fix Modal Search Results', desc: 'The discovery Fix modal now sorts search results to prioritize standard album versions over live recordings, remixes, covers, soundtracks, remasters, and deluxe editions. Previously the first result was often a live or remix version instead of the original studio track' },