Filter ITAD deals to only include games and DLC

Non-game content (courses, software bundles) was showing up in deal
posts. Filter on the API's type field to only include entries with
type "game" or "dlc".

https://claude.ai/code/session_01B7YPGrE3NatkwadCXVjv2j
This commit is contained in:
Claude
2026-02-28 05:14:27 +00:00
parent d1a33e97c5
commit 949eceb983

View File

@@ -81,11 +81,18 @@ async def fetch_deals(
if not deal_data:
continue
# Only include actual games and DLC — skip non-game content
# (courses, software bundles, etc.)
entry_type = entry.get("type")
title = entry.get("title", "?")
if entry_type not in ("game", "dlc"):
logger.debug("Filtered out %s: type=%s", title, entry_type)
continue
cut = deal_data.get("cut", 0)
price_amount = deal_data.get("price", {}).get("amount", 0)
regular_amount = deal_data.get("regular", {}).get("amount", 0)
currency = deal_data.get("price", {}).get("currency", "USD")
title = entry.get("title", "?")
# Apply filters
if cut < min_discount: