Skip to content

Commit

Permalink
Fix old settings overwriting new settings on upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
lay295 committed Jun 5, 2021
1 parent 6c8cbf9 commit f6cbca4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
3 changes: 3 additions & 0 deletions TwitchDownloaderWPF/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@
<setting name="SubMessages" serializeAs="String">
<value>True</value>
</setting>
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
</TwitchDownloader.Properties.Settings>
</userSettings>
</configuration>
9 changes: 7 additions & 2 deletions TwitchDownloaderWPF/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ private void btnQueue_Click(object sender, RoutedEventArgs e)
private async void Window_Loaded(object sender, RoutedEventArgs e)
{
Main.Content = pageVodDownload;
Settings.Default.Upgrade();
Settings.Default.Save();
if (Settings.Default.UpgradeRequired)
{
Settings.Default.Upgrade();
Settings.Default.UpgradeRequired = false;
Settings.Default.Save();
}

if (!File.Exists("ffmpeg.exe"))
await FFmpegDownloader.GetLatestVersion(FFmpegVersion.Full);

Expand Down
12 changes: 12 additions & 0 deletions TwitchDownloaderWPF/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions TwitchDownloaderWPF/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,8 @@
<Setting Name="SubMessages" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="UpgradeRequired" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit f6cbca4

Please sign in to comment.