Added AppSettings

Added AppSettings for FreeTubeSyncer.
This commit is contained in:
Mario Steele 2025-07-31 03:28:08 -05:00
parent ddf50a3052
commit ec55cf2f11

View file

@ -0,0 +1,27 @@
using System.Text.Json.Serialization;
using CommunityToolkit.Mvvm.ComponentModel;
namespace FreeTubeSyncer.Models;
public partial class AppSettings : ObservableObject
{
[ObservableProperty] [property: JsonInclude] private string _restBaseUrl = "http://127.0.0.1:8080";
[ObservableProperty] [property: JsonInclude] private int _checkInterval = 30;
[ObservableProperty] [property: JsonInclude] private bool _syncHistory = true;
[ObservableProperty] [property: JsonInclude] private bool _syncPlaylist = true;
[ObservableProperty] [property: JsonInclude] private bool _syncProfile = true;
[ObservableProperty] [property: JsonInclude] private bool _syncSearchHistory = true;
[ObservableProperty] [property: JsonInclude] private bool _syncSettings = true;
[ObservableProperty] [property: JsonIgnore] private bool _settingsDirty = false;
public AppSettings()
{
PropertyChanged += (sender, args) =>
{
if (args.PropertyName == nameof(SettingsDirty))
return;
SettingsDirty = true;
};
}
}