From e00ee2cc555d54c54f95b85dfa464cc490ba8a26 Mon Sep 17 00:00:00 2001 From: Archi Date: Sat, 26 Feb 2022 01:26:13 +0100 Subject: [PATCH] Misc --- .../GlobalCache.cs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/GlobalCache.cs b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/GlobalCache.cs index 95aeba6d7..1ab9af806 100644 --- a/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/GlobalCache.cs +++ b/ArchiSteamFarm.OfficialPlugins.SteamTokenDumper/GlobalCache.cs @@ -281,19 +281,38 @@ internal sealed class GlobalCache : SerializableFile { ArgumentNullException.ThrowIfNull(packages); ArgumentNullException.ThrowIfNull(depots); + bool save = false; + foreach ((uint appID, ulong token) in apps) { + if (SubmittedApps.TryGetValue(appID, out ulong previousToken) && (previousToken == token)) { + continue; + } + SubmittedApps[appID] = token; + save = true; } foreach ((uint packageID, ulong token) in packages) { + if (SubmittedPackages.TryGetValue(packageID, out ulong previousToken) && (previousToken == token)) { + continue; + } + SubmittedPackages[packageID] = token; + save = true; } foreach ((uint depotID, string key) in depots) { + if (SubmittedDepots.TryGetValue(depotID, out string? previousKey) && (previousKey == key)) { + continue; + } + SubmittedDepots[depotID] = key; + save = true; } - Utilities.InBackground(Save); + if (save) { + Utilities.InBackground(Save); + } } private static bool IsValidDepotKey(string depotKey) {