Skip to content

Commit 10392e9

Browse files
committed
feat: Trim config.json file (remove App/Fw Update URLs)
1 parent fa8b4f0 commit 10392e9

5 files changed

Lines changed: 4 additions & 30 deletions

File tree

PostCodeSerialMonitor/Models/AppConfiguration.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,16 @@ public class AppConfiguration
77
{
88
[Required]
99
[Range(1, int.MaxValue)]
10-
public int FormatVersion { get; set; } = 1;
10+
public int FormatVersion { get; set; } = 2;
1111

1212
public bool CheckForAppUpdates { get; set; } = true;
1313
public bool CheckForCodeUpdates { get; set; } = true;
1414
public bool CheckForFwUpdates { get; set; } = true;
1515

16-
[Required]
17-
[Url]
18-
public Uri AppUpdateUrl { get; set; } = new Uri("https://example.com/todo");
19-
2016
[Required]
2117
[Url]
2218
public Uri CodesMetaBaseUrl { get; set; } = new Uri("https://errors.xboxresearch.com");
2319

24-
[Required]
25-
[Url]
26-
public Uri FwUpdateUrl { get; set; } = new Uri("https://example.com/todo");
27-
2820
[Required]
2921
public string Language { get; set; } = "en-US";
3022

PostCodeSerialMonitor/ServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace PostCodeSerialMonitor;
1212

1313
public static class ServiceCollectionExtensions
1414
{
15-
const int SUPPORTED_CONFIG_FORMAT_VERSION = 1;
15+
const int SUPPORTED_CONFIG_FORMAT_VERSION = 2;
1616
public static void AddCommonServices(this IServiceCollection collection)
1717
{
1818
// Configure logging

PostCodeSerialMonitor/ViewModels/ConfigurationDialogViewModel.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,9 @@ public partial class ConfigurationDialogViewModel : ViewModelBase
2828
[ObservableProperty]
2929
private bool checkForFwUpdates;
3030

31-
[ObservableProperty]
32-
private string appUpdateUrl;
33-
3431
[ObservableProperty]
3532
private string codesMetaBaseUrl;
3633

37-
[ObservableProperty]
38-
private string fwUpdateUrl;
39-
4034
[ObservableProperty]
4135
private ObservableCollection<string> languages;
4236

@@ -61,9 +55,7 @@ public ConfigurationDialogViewModel(ConfigurationService configurationService)
6155
CheckForAppUpdates = _originalConfiguration.CheckForAppUpdates;
6256
CheckForCodeUpdates = _originalConfiguration.CheckForCodeUpdates;
6357
CheckForFwUpdates = _originalConfiguration.CheckForFwUpdates;
64-
AppUpdateUrl = _originalConfiguration.AppUpdateUrl.ToString();
6558
CodesMetaBaseUrl = _originalConfiguration.CodesMetaBaseUrl.ToString();
66-
FwUpdateUrl = _originalConfiguration.FwUpdateUrl.ToString();
6759
SelectedLanguage = _originalConfiguration.Language;
6860

6961
//Add available languages
@@ -80,9 +72,7 @@ await _configurationService.UpdateConfigurationAsync(config =>
8072
config.CheckForAppUpdates = CheckForAppUpdates;
8173
config.CheckForCodeUpdates = CheckForCodeUpdates;
8274
config.CheckForFwUpdates = CheckForFwUpdates;
83-
config.AppUpdateUrl = new Uri(AppUpdateUrl);
8475
config.CodesMetaBaseUrl = new Uri(CodesMetaBaseUrl);
85-
config.FwUpdateUrl = new Uri(FwUpdateUrl);
8676
config.Language = SelectedLanguage;
8777
});
8878

PostCodeSerialMonitor/Views/ConfigurationDialog.axaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323

2424
<CheckBox Content="{x:Static assets:Resources.CheckApplicationUpdates}"
2525
IsChecked="{Binding CheckForAppUpdates}"/>
26-
<TextBox Text="{Binding AppUpdateUrl}"
27-
Watermark="{x:Static assets:Resources.ApplicationUpdateUrl}"
28-
IsEnabled="{Binding CheckForAppUpdates}"/>
29-
26+
3027
<CheckBox Content="{x:Static assets:Resources.CheckCodeUpdates}"
3128
IsChecked="{Binding CheckForCodeUpdates}"
3229
Margin="0,10,0,0"/>
@@ -37,9 +34,6 @@
3734
<CheckBox Content="{x:Static assets:Resources.CheckFirmwareUpdates}"
3835
IsChecked="{Binding CheckForFwUpdates}"
3936
Margin="0,10,0,0"/>
40-
<TextBox Text="{Binding FwUpdateUrl}"
41-
Watermark="{x:Static assets:Resources.FirmwareUpdateUrl}"
42-
IsEnabled="{Binding CheckForFwUpdates}"/>
4337
</StackPanel>
4438
</ScrollViewer>
4539

PostCodeSerialMonitor/config.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
{
22
"AppConfiguration": {
3-
"FormatVersion": 1,
3+
"FormatVersion": 2,
44
"CheckForAppUpdates": true,
55
"CheckForCodeUpdates": true,
66
"CheckForFwUpdates": true,
7-
"AppUpdateUrl": "https://example.com/todo",
87
"CodesMetaBaseUrl": "https://errors.xboxresearch.com/",
9-
"FwUpdateUrl": "https://example.com/todo",
108
"MetaStoragePath": "meta",
119
"Language": "en-US",
1210
"MetaJsonUrl": "https://errors.xboxresearch.com/meta.json"

0 commit comments

Comments
 (0)