From b08c22e77b405d9ad6d23e4fb1d1dd5701b39660 Mon Sep 17 00:00:00 2001 From: Mario Steele Date: Mon, 21 Jul 2025 17:08:17 -0500 Subject: [PATCH] Updated Profile Updated code to filter out subscriptions that have been removed from the profile, and insert new ones into the list in the Update() fucntion. --- FreeTubeSync/Model/Profile.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/FreeTubeSync/Model/Profile.cs b/FreeTubeSync/Model/Profile.cs index 22d7608..e07c324 100644 --- a/FreeTubeSync/Model/Profile.cs +++ b/FreeTubeSync/Model/Profile.cs @@ -18,6 +18,19 @@ public class Profile if (other.name != name) name = other.name; if (other.bgColor != bgColor) bgColor = other.bgColor; if (other.textColor != textColor) textColor = other.textColor; - if (other.subscriptions.Count != subscriptions.Count) subscriptions = other.subscriptions; + var remove = new List(); + foreach (var sub in subscriptions) + { + if (other.subscriptions.Any(x => x.id == sub.id)) continue; + remove.Add(sub); + } + subscriptions.RemoveAll(x => remove.Contains(x)); + remove.Clear(); + foreach (var sub in other.subscriptions) + { + if (subscriptions.Any(x => x.id == sub.id)) continue; + remove.Add(sub); + } + subscriptions.AddRange(remove); } } \ No newline at end of file