From 8e65cc3a4b82e2047a1f2310383a00250ad4dfef Mon Sep 17 00:00:00 2001 From: Mario Steele Date: Thu, 24 Jul 2025 04:29:13 -0500 Subject: [PATCH] Updated Setting Updated Seting class to use string for teh data, and the data is the full setting line, to allow for the flexability for Any data value in the field. Implemented MarshalData() and JsonData() functions. --- .../Models/DatabaseModels/Setting.cs | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/FreeTubeSyncer/Models/DatabaseModels/Setting.cs b/FreeTubeSyncer/Models/DatabaseModels/Setting.cs index 68f7dfc..42af9ca 100644 --- a/FreeTubeSyncer/Models/DatabaseModels/Setting.cs +++ b/FreeTubeSyncer/Models/DatabaseModels/Setting.cs @@ -8,17 +8,19 @@ public class Setting : IDataModel { #pragma warning disable CS8618 public string _id { get; set; } = string.Empty; - public string? ValueJson { get; set; } -#pragma warning restore CS8618 - - public object Value - { -#pragma warning disable CS8603 - get => string.IsNullOrEmpty(ValueJson) ? null : JsonSerializer.Deserialize(ValueJson); -#pragma warning restore CS8603 - set => ValueJson = JsonSerializer.Serialize(value); - } - + public string value { get; set; } = string.Empty; + public string Id() => _id; public bool EqualId(string oid) => _id == oid; + + public void MarshalData(string id, string data) + { + _id = id; + value = data; + } + + public string JsonData() + { + return value; + } } \ No newline at end of file