From b0b1c22f80683d3b2d72b75c829c11be3ce27ea5 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Sun, 22 Mar 2026 08:24:35 -0700 Subject: [PATCH] Read codec/bitrate from current settings at fix time, not scan time The lossy converter fix handler now reads codec and bitrate fresh from the Settings page when converting, not from what was stored in the finding details at scan time. Users can change their codec preference after scanning and Fix All will use the new setting. --- core/repair_worker.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/core/repair_worker.py b/core/repair_worker.py index 0064cfef..34cc9038 100644 --- a/core/repair_worker.py +++ b/core/repair_worker.py @@ -1910,13 +1910,21 @@ class RepairWorker: return {'success': False, 'error': str(e)} def _fix_missing_lossy_copy(self, entity_type, entity_id, file_path, details): - """Convert a FLAC file to the configured lossy codec using ffmpeg.""" + """Convert a FLAC file to the configured lossy codec using ffmpeg. + + Always reads codec/bitrate from current settings (not finding details) + so the user can change their preference after scanning. + """ if not file_path: return {'success': False, 'error': 'No file path associated with this finding'} - codec = details.get('codec', 'mp3') - bitrate = details.get('bitrate', '320') - quality_label = details.get('quality_label', f'{codec.upper()}-{bitrate}') + # Read fresh from current settings — not from finding details + codec = 'mp3' + bitrate = '320' + if self._config_manager: + codec = self._config_manager.get('lossy_copy.codec', 'mp3').lower() + bitrate = self._config_manager.get('lossy_copy.bitrate', '320') + quality_label = f'{codec.upper()}-{bitrate}' codec_configs = { 'mp3': ('libmp3lame', '.mp3', ['-id3v2_version', '3']),