Default ITAD_DEALS_LIMIT to 200 (API max) to maximise deal coverage

Since the ITAD API only sorts by discount or price (no time-based sort),
fetching the full 200-deal window per country ensures our client-side
filtering sees every available deal rather than just the top N by discount.
The dedup database already prevents reposting, so the extra data is cheap.

https://claude.ai/code/session_01EfPjktyrF24DBNHWsY1KBP
This commit is contained in:
Claude
2026-02-28 23:42:54 +00:00
parent e4d90d0331
commit f13bfd7b07
4 changed files with 10 additions and 5 deletions

View File

@@ -50,10 +50,15 @@ async def fetch_deals(
countries: list[str] | None = None,
max_price: float = 20,
min_discount: float = 50,
limit: int = 100,
limit: int = 200,
) -> list[ITADDeal]:
"""Fetch current deals from IsThereAnyDeal across one or more countries.
Defaults to the API maximum of 200 deals per country so that client-side
filtering (discount, price, type) has the widest possible pool to work
with — this avoids missing deals that wouldn't appear in a smaller window
sorted only by discount.
Deals are fetched per-country, merged (first country in the list wins
when the same game+shop appears in multiple regions), and finally sorted
by timestamp so that the newest deals appear first.
@@ -105,7 +110,7 @@ async def _fetch_country_deals(
country: str = "US",
max_price: float = 20,
min_discount: float = 50,
limit: int = 100,
limit: int = 200,
) -> list[ITADDeal]:
"""Fetch deals for a single country from the ITAD ``/deals/v2`` endpoint."""
params: dict = {