chore(screenscraper): tighten the quota wording and comments

Name the reset timezone by its shortcode, and drop comments that either
restate the code or explain a change rather than the behaviour.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Georges-Antoine Assi
2026-07-30 17:43:37 -04:00
parent a55d50998e
commit f8bbb8af18
3 changed files with 8 additions and 10 deletions

View File

@@ -175,7 +175,7 @@ def _trip_daily_quota(reason: str) -> None:
if not _state.daily_quota_exhausted:
log.warning(
"ScreenScraper %s; skipping ScreenScraper for the rest of this scan "
"(quotas reset at midnight French time)",
"(quotas reset at midnight CET)",
reason,
)
_state.daily_quota_exhausted = True
@@ -305,7 +305,7 @@ def _warn_on_low_quota(limits: SSAccountLimits) -> None:
if remaining <= allowance * SS_LOW_QUOTA_FRACTION:
log.warning(
"ScreenScraper: only %d of %d daily %s left, "
"the quota resets at midnight French time",
"the quota resets at midnight CET",
remaining,
allowance,
label,
@@ -450,7 +450,7 @@ class ScreenScraperService:
if _state.daily_quota_exhausted:
raise HTTPException(
status_code=status.HTTP_429_TOO_MANY_REQUESTS,
detail="ScreenScraper daily quota exhausted. It resets at midnight French time.",
detail="ScreenScraper daily quota exhausted. It resets at midnight CET.",
)
aiohttp_session = ctx_aiohttp_session.get()
@@ -503,13 +503,13 @@ class ScreenScraperService:
_trip_daily_quota("daily scrape quota exhausted")
raise HTTPException(
status_code=status.HTTP_429_TOO_MANY_REQUESTS,
detail="ScreenScraper daily scrape quota exhausted. It resets at midnight French time.",
detail="ScreenScraper daily scrape quota exhausted. It resets at midnight CET.",
) from err
elif err.status == 431:
_trip_daily_quota("daily unrecognized-ROM quota exhausted")
raise HTTPException(
status_code=status.HTTP_429_TOO_MANY_REQUESTS,
detail="ScreenScraper daily unrecognized-ROM quota exhausted. It resets at midnight French time.",
detail="ScreenScraper daily unrecognized-ROM quota exhausted. It resets at midnight CET.",
) from err
elif err.status == 423:
raise HTTPException(
@@ -574,13 +574,13 @@ class ScreenScraperService:
_trip_daily_quota("daily scrape quota exhausted")
raise HTTPException(
status_code=status.HTTP_429_TOO_MANY_REQUESTS,
detail="ScreenScraper daily scrape quota exhausted. It resets at midnight French time.",
detail="ScreenScraper daily scrape quota exhausted. It resets at midnight CET.",
) from err
elif err.status == 431:
_trip_daily_quota("daily unrecognized-ROM quota exhausted")
raise HTTPException(
status_code=status.HTTP_429_TOO_MANY_REQUESTS,
detail="ScreenScraper daily unrecognized-ROM quota exhausted. It resets at midnight French time.",
detail="ScreenScraper daily unrecognized-ROM quota exhausted. It resets at midnight CET.",
) from err
elif err.status == 423:
raise HTTPException(

View File

@@ -10,8 +10,6 @@ class SSUser(TypedDict):
maxrequestspermin: NotRequired[str]
maxrequestsperday: NotRequired[str]
requeststoday: NotRequired[str]
# ROMs ScreenScraper does not recognize count against their own, smaller,
# daily allowance on top of the total one.
maxrequestskoperday: NotRequired[str]
requestskotoday: NotRequired[str]
maxdownloadspeed: NotRequired[str]

View File

@@ -79,7 +79,7 @@ TGDB_API_ENABLED=false # Enable TheGamesDB API integration
# Scans & Tasks
SCAN_TIMEOUT=14400 # Timeout for background scan/rescan tasks in seconds
SCAN_WORKERS=1 # How many ROMs a scan processes at once, which also caps concurrent metadata requests
SCAN_WORKERS=1 # How many ROMs a scan processes at once
TASK_TIMEOUT=300 # Timeout for other background tasks in seconds
TASK_RESULT_TTL=86400 # How long to keep task results in Valkey in seconds
SEVEN_ZIP_TIMEOUT=60 # Timeout for 7-Zip operations in seconds