From 7607cb4348d0cbcb14ca037f8f583d074f9213a8 Mon Sep 17 00:00:00 2001 From: Citrinate Date: Fri, 13 Dec 2024 11:34:15 -0500 Subject: [PATCH] Include DLC which don't require base game --- FreePackages/PackageFilter/Filterables/FilterableApp.cs | 2 ++ FreePackages/PackageFilter/PackageFilter.cs | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/FreePackages/PackageFilter/Filterables/FilterableApp.cs b/FreePackages/PackageFilter/Filterables/FilterableApp.cs index 7ea4c3b..587df37 100644 --- a/FreePackages/PackageFilter/Filterables/FilterableApp.cs +++ b/FreePackages/PackageFilter/Filterables/FilterableApp.cs @@ -28,6 +28,7 @@ internal sealed class FilterableApp { internal List? OSList; internal uint DeckCompatibility; internal DateTime SteamReleaseDate; + internal bool ActivationOnlyDLC; internal bool Hidden; internal FilterableApp(SteamApps.PICSProductInfoCallback.PICSProductInfo productInfo) : this(productInfo.ID, productInfo.KeyValues) {} @@ -57,6 +58,7 @@ internal FilterableApp(uint id, KeyValue kv) { OSList = kv["common"]["oslist"].AsString()?.ToUpper().Split(",").ToList(); DeckCompatibility = kv["common"]["steam_deck_compatibility"]["category"].AsUnsignedInteger(); SteamReleaseDate = DateTimeOffset.FromUnixTimeSeconds(kv["common"]["steam_release_date"].AsUnsignedInteger()).UtcDateTime; + ActivationOnlyDLC = kv["extended"]["activationonlydlc"].AsBoolean(); Hidden = kv["common"] == KeyValue.Invalid; // Fix the category for games which do have trading cards, but which don't have the trading card category, Ex: https://steamdb.info/app/316260/ diff --git a/FreePackages/PackageFilter/PackageFilter.cs b/FreePackages/PackageFilter/PackageFilter.cs index 7abb4a0..aa3fa53 100644 --- a/FreePackages/PackageFilter/PackageFilter.cs +++ b/FreePackages/PackageFilter/PackageFilter.cs @@ -70,7 +70,12 @@ internal bool IsRedeemableApp(FilterableApp app, HashSet? includedAppIDs = if (app.DLCForAppID > 0 && !OwnedAppIDs.Contains(app.DLCForAppID) && (includedAppIDs == null || !includedAppIDs.Contains(app.DLCForAppID))) { // Missing a necessary app // Note: Some apps have only DLCForAppid and are missing MustOwnAppToPurchase, so we need to check this also, ex: https://steamdb.info/app/41046 - return false; + + if (!app.ActivationOnlyDLC) { + // Some DLC can be redeemed without owning the base game, ex: https://steamdb.info/app/2765950/ + // All I see that's special here is having ActivationOnlyDLC set to true, and missing MustOwnAppToPurchase + return false; + } } if (app.RestrictedCountries != null && app.RestrictedCountries.Contains(Country, StringComparer.OrdinalIgnoreCase)) {