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.
This commit is contained in:
parent
bd27bbe1b2
commit
b0b1c22f80
1 changed files with 12 additions and 4 deletions
|
|
@ -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']),
|
||||
|
|
|
|||
Loading…
Reference in a new issue