Skip to content

Commit

Permalink
Preserve settings for builtin formats
Browse files Browse the repository at this point in the history
The settings of builtin formats were not disabled anymore
in Settings - Formats since e1f8906 (last working in release: 2.1.7).
They were only disabled at the first start of CUETools. As soon as a
settings.txt file was available, this was not the case anymore.

- Furthermore, this fixes availability of newly added formats like
  aiff, if a settings.txt file from a previous version of CUETools is
  already present.
  • Loading branch information
c72578 committed Oct 21, 2023
1 parent 955881a commit 6eae07c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CUETools.Processor/CUEConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,9 @@ public void Load(SettingsReader sr)
advanced.decodersViewModel = new DecoderListViewModel(advanced.decoders);

// Reset the links in formats
foreach (var extension in formats.Keys)
foreach (var extension in backup.formats.Keys)
{
var format = formats[extension];
var format = backup.formats[extension];
AudioEncoderSettingsViewModel encoderLossless, encoderLossy;
AudioDecoderSettingsViewModel decoder;
if (format.encoderLossless == null || !Encoders.TryGetValue(extension, true, format.encoderLossless.Name, out encoderLossless))
Expand All @@ -468,6 +468,7 @@ public void Load(SettingsReader sr)
format.encoderLossless = encoderLossless;
format.encoderLossy = encoderLossy;
format.decoder = decoder;
advanced.formats.Add(extension, format);
}
}
catch (Exception ex)
Expand Down

0 comments on commit 6eae07c

Please sign in to comment.