Find Steam artwork for newer games #42

Merged
ethan-hann merged 3 commits from issue-38-steam-artwork-new-layout into main 2026-10-23 22:52:27 -05:00
Owner

Fixes #38: artwork was not found for newer Steam games.

  • Local cache: the tall image also accepts library_capsule.jpg (and _2x), the wide image also accepts library_header.jpg; the newest complete image among the accepted names wins, and hero, blur, logo, and icon files are never taken.
  • Online: when both plain addresses return 404 for a kind, SavePoint asks the store API (IStoreBrowseService/GetItems, no key) once per app for the asset names and fetches the hashed path from shared.akamai.steamstatic.com. The answer is validated (same app id, strict asset-name pattern) before any URL is built. A broken answer is a failure, not a miss, so the 7-day miss memory is not written for it.
  • D30 records the new names, the hashed paths, the API host, and the evidence.

Checked against real data, not only fakes: the fixed code run by reflection against the real Steam folder (950 cached apps) finds 893 wide and 454 tall images where the old code found 720 and 380, which equals the number of files under either name. Against Steam live servers it found both images for 3669870 (hashed paths only) and for two older games (489830, 1245620).

Tests: 66 new SteamCdnStoreTests, 5 new SteamLocalCacheTests, 1 new ArtworkOnlineTests case; reds recorded in the commits; first-run passes mutation-checked.

Fixes #38: artwork was not found for newer Steam games. - Local cache: the tall image also accepts library_capsule.jpg (and _2x), the wide image also accepts library_header.jpg; the newest complete image among the accepted names wins, and hero, blur, logo, and icon files are never taken. - Online: when both plain addresses return 404 for a kind, SavePoint asks the store API (IStoreBrowseService/GetItems, no key) once per app for the asset names and fetches the hashed path from shared.akamai.steamstatic.com. The answer is validated (same app id, strict asset-name pattern) before any URL is built. A broken answer is a failure, not a miss, so the 7-day miss memory is not written for it. - D30 records the new names, the hashed paths, the API host, and the evidence. Checked against real data, not only fakes: the fixed code run by reflection against the real Steam folder (950 cached apps) finds 893 wide and 454 tall images where the old code found 720 and 380, which equals the number of files under either name. Against Steam live servers it found both images for 3669870 (hashed paths only) and for two older games (489830, 1245620). Tests: 66 new SteamCdnStoreTests, 5 new SteamLocalCacheTests, 1 new ArtworkOnlineTests case; reds recorded in the commits; first-run passes mutation-checked.
Newer games are cached as library_capsule.jpg / library_capsule_2x.jpg (tall) and library_header.jpg (wide) in hashed subfolders, so the local lookup found nothing for them. The tall kind now also accepts the capsule names, the wide kind library_header.jpg; the newest complete image among all accepted names still wins. Hero, blur, logo and icon files are never taken.

Observed reds before the change: the hashed-subfolder, double-size capsule and newest-across-names tests failed on Assert.Equal (expected a path, actual null). The unfinished-new-name and never-taken tests passed first run; a mutation (probe check removed, library_hero.jpg added to the wide names) made both fail.
Newer games are not served at the plain steamstatic addresses (all 404), only under a hashed path that the store API lists. When both plain addresses say not found for a kind, SteamCdn now asks api.steampowered.com once per lookup (a StoreAssetsMemo is shared by the wide and tall fetch) and fetches the named asset from shared.akamai.steamstatic.com: tall takes library_capsule_2x else library_capsule, wide takes header. The answer is capped at 256 KB and parsed with System.Text.Json; the URL format must start with steam/apps/<same id>/ and hold the placeholder once, and asset names must match an optional 40-hex folder plus a plain .jpg name, else the kind counts as not found and nothing is followed. A store answer that is not a plain 200, is bad JSON, is about another app or breaks the format rule is Failed, so no miss is remembered. Older games still cost no extra request.

Observed red before the change: 58 of the 66 new SteamCdnStoreTests failed on assertions (outcome, URL list, request counts, Failed/NotFound outcomes) with the pre-change fetch. Eight passed first run; mutations (always take the store path; treat a missing assets object as Failed; drop the memo in ArtworkApi) made the plain-failed-asks-nothing, no-assets, and shared-request tests fail. Existing tests that relied on a bare 404 from every address now answer the store with an empty item list, since a 404 from the store is a Failed.
docs: D30 names Steam's newer cache names, the hashed image paths, and the store API host
Some checks failed
Gate / linux (pull_request) Successful in 13m26s
Gate / linux (push) Has been cancelled
f70a9e665c
Closes #38
ethan-hann deleted branch issue-38-steam-artwork-new-layout 2026-10-23 22:52:28 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ethan-hann/SavePoint!42
No description provided.