|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Helper class for discovering and accessing Steam game images. More...
#include <steam_integration.h>
Static Public Member Functions | |
| static GameImagePaths | discoverImages (uint32_t appId, const std::filesystem::path &steamRoot) |
| Find all available images for a Steam game. | |
| static bool | downloadImage (uint32_t appId, ImageType type, const std::string &outputPath) |
| Download image from Steam CDN (fallback only). | |
| static std::string | getCDNUrl (uint32_t appId, ImageType type) |
| Build CDN URL for a specific image type. | |
| static std::filesystem::path | getLibraryCachePath (const std::filesystem::path &steamRoot) |
| Get path to Steam's library cache directory. | |
Helper class for discovering and accessing Steam game images.
Provides utilities to find game images in Steam's local cache or download from Steam's CDN. Prioritizes local cache to avoid unnecessary downloads.
Definition at line 61 of file steam_integration.h.
|
static |
Find all available images for a Steam game.
| appId | Steam App ID |
| steamRoot | Primary Steam root path (e.g., ~/.steam/steam) |
IMPORTANT: Steam stores ALL game images in the PRIMARY Steam root's cache, not in individual library folders. Pass getPrimarySteamRoot(), not the library path where the game is installed.
Searches Steam's local cache (appcache/librarycache/) for all available image types. Returns paths to existing files, leaving empty strings for unavailable images.
Definition at line 89 of file steam_integration.cpp.
References GameImagePaths::capsule, Logger::debug(), getLibraryCachePath(), GameImagePaths::header, GameImagePaths::heroImage, GameImagePaths::icon, Logger::info(), GameImagePaths::logo, and GameImagePaths::verticalCover.
Referenced by GameLibrary::discoverImagesForGame(), SteamGame::downloadCoverArt(), GameLibrary::refreshStaleImages(), and SteamGame::toGame().
|
static |
Download image from Steam CDN (fallback only).
| appId | Steam App ID |
| type | Image type |
| outputPath | Where to save the downloaded image |
This is a fallback for when images are not in local cache. Tries multiple CDN hosts with timeout and error handling.
Definition at line 296 of file steam_integration.cpp.
References ShellUtils::escapeArg(), ProcessExecutor::execute(), and ProcessResult::success.
Referenced by SteamGame::downloadCoverArt().
|
static |
Build CDN URL for a specific image type.
| appId | Steam App ID |
| type | Image type |
Definition at line 286 of file steam_integration.cpp.
|
static |
Get path to Steam's library cache directory.
| steamRoot | Primary Steam root path |
Definition at line 84 of file steam_integration.cpp.
Referenced by discoverImages().