game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
SteamCDN Class Reference

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.

Detailed Description

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.

Member Function Documentation

◆ discoverImages()

GameImagePaths SteamCDN::discoverImages ( uint32_t appId,
const std::filesystem::path & steamRoot )
static

Find all available images for a Steam game.

Parameters
appIdSteam App ID
steamRootPrimary Steam root path (e.g., ~/.steam/steam)
Returns
GameImagePaths with all discovered image paths

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().

◆ downloadImage()

bool SteamCDN::downloadImage ( uint32_t appId,
ImageType type,
const std::string & outputPath )
static

Download image from Steam CDN (fallback only).

Parameters
appIdSteam App ID
typeImage type
outputPathWhere to save the downloaded image
Returns
True if download succeeded

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().

◆ getCDNUrl()

std::string SteamCDN::getCDNUrl ( uint32_t appId,
ImageType type )
static

Build CDN URL for a specific image type.

Parameters
appIdSteam App ID
typeImage type
Returns
HTTPS URL to Steam CDN image

Definition at line 286 of file steam_integration.cpp.

◆ getLibraryCachePath()

std::filesystem::path SteamCDN::getLibraryCachePath ( const std::filesystem::path & steamRoot)
static

Get path to Steam's library cache directory.

Parameters
steamRootPrimary Steam root path
Returns
Path to librarycache directory (steamRoot/appcache/librarycache)

Definition at line 84 of file steam_integration.cpp.

Referenced by discoverImages().


The documentation for this class was generated from the following files: