1
0
Fork 0

Reduce number of Steam API requests.

This commit is contained in:
Casper V. Kristensen 2019-05-10 00:44:41 +02:00
parent 3fc2e15faa
commit 26fca8373b
Signed by: caspervk
GPG key ID: 289CA03790535054

View file

@ -102,8 +102,8 @@ def update_info(release: Release) -> None:
release.game_name = package_details["name"] release.game_name = package_details["name"]
# Use the "base game" of the package as the basis for further computation. # Use the "base game" of the package as the basis for further computation.
# We guesstimate the base game as the most popular app (i.e. the one with the most reviews) # We guesstimate the base game as the most popular app (i.e. the one with most reviews) among the first three
package_appids = [app["id"] for app in package_details["apps"]] package_appids = [app["id"] for app in package_details["apps"][:3]]
package_apps_details = [appdetails(appid) for appid in package_appids] package_apps_details = [appdetails(appid) for appid in package_appids]
details = max(package_apps_details, key=lambda app: reviews(app["steam_appid"])[1]) details = max(package_apps_details, key=lambda app: reviews(app["steam_appid"])[1])
appid = details["steam_appid"] appid = details["steam_appid"]
@ -123,6 +123,6 @@ def update_info(release: Release) -> None:
release.type = "DLC" release.type = "DLC"
# Add highlight if "denuvo" occurs in Steam's DRM notice or potential 3rd-party EULA # Add highlight if "denuvo" occurs in Steam's DRM notice or potential 3rd-party EULA
if "denuvo" in (details.get("drm_notice", "") + eula(appid)).lower(): if "denuvo" in details.get("drm_notice", "").lower() or "denuvo" in eula(appid).lower():
logger.info("'denuvo' found in Steam DRM-notice/EULA; adding 'DENUVO' to highlights") logger.info("'denuvo' found in Steam DRM-notice/EULA; adding 'DENUVO' to highlights")
release.highlights.append("DENUVO") release.highlights.append("DENUVO")