diff --git a/BoosterManager/Data/MarketableApps.cs b/BoosterManager/Data/MarketableApps.cs index ef1ad52..d4ad8d0 100644 --- a/BoosterManager/Data/MarketableApps.cs +++ b/BoosterManager/Data/MarketableApps.cs @@ -48,7 +48,7 @@ internal static async Task Update() { || marketableOverrideResponse == null || marketableOverrideResponse.Content == null || unmarketableOverrideResponse == null || unmarketableOverrideResponse.Content == null ) { - ASF.ArchiLogger.LogGenericDebug("Failed to fetch marketable apps data"); + ASF.ArchiLogger.LogGenericDebug(Strings.MarketableAppDataFetchFailed); return false; } @@ -58,7 +58,7 @@ internal static async Task Update() { UnmarketableOverrides = unmarketableOverrideResponse.Content; LastUpdate = DateTime.Now; - // We're good to stop here, but let's try to replace the cached data that may be up to 1 hour old with fresh data from Steam + // We're good to stop here, but let's try to update the cached data that may be up to 1 hour old with fresh data from Steam await UpdateFromSteam().ConfigureAwait(false); return true; @@ -114,12 +114,9 @@ private static async Task UpdateFromSteam() { LastSteamUpdate = DateTime.Now; - if (AppIDs.Count - newerAppIDs.Count > 1000) { - // Bad data from Steam, ignore it - return; - } - - AppIDs = newerAppIDs.Union(MarketableOverrides).Except(UnmarketableOverrides).ToHashSet(); + // Steam's ISteamApps/GetAppList API is unreliable (more details: https://github.com/Citrinate/Steam-MarketableApps/blob/main/update.py) + // Due to this, we should only add apps from this API to our existing list of AppIDs, and should never remove apps just because they don't appear in this API's response + AppIDs.UnionWith(newerAppIDs.Except(UnmarketableOverrides)); } } } diff --git a/BoosterManager/Localization/Strings.resx b/BoosterManager/Localization/Strings.resx index cb0a1b5..a413979 100644 --- a/BoosterManager/Localization/Strings.resx +++ b/BoosterManager/Localization/Strings.resx @@ -561,4 +561,8 @@ No boosters will be crafted. This bot either can't craft the requested boosters, or the requested boosters are unmarketable. The following boosters are unmarketable: {0} {0} will be replaced by a list of appIDs + + Failed to fetch marketable apps data + + \ No newline at end of file diff --git a/README.md b/README.md index db2ef4a..2d9728e 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,9 @@ Command | Alias | "AllowCraftUnmarketableBoosters": false, ``` +> [!NOTE] +> The plugin cannot immediately detect when a game's boosters switch from being marketable to unmarketable. It will usually take ~4 hours to detect this change. + --- ### GamesToBooster