|
game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
|
Service for fetching game images from SteamGridDB. More...
#include <steamgriddb_service.h>
Static Public Member Functions | |
| static void | clearCache () |
| Clear all cached images. | |
| static std::string | downloadBestCover (const std::string &gameName) |
| Download best cover art for a game by name. | |
| static void | downloadBestCoverAsync (const std::string &gameName, const std::function< void(const std::string &)> &callback) |
| Download best cover art asynchronously. | |
| static std::string | downloadImage (const SteamGridDBImage &image, const std::string &gameName) |
| Download an image to local cache. | |
| static SteamGridDBImageSet | getAllImages (int gameId) |
| Get all images for a game. | |
| static std::string | getCachedCover (const std::string &gameName) |
| Check if we have a cached cover for a game. | |
| static std::string | getCacheDirectory () |
| Get the cache directory for downloaded images. | |
| static size_t | getCacheSize () |
| Get total size of cached images in bytes. | |
| static SteamGridDBGame | getGameBySteamAppId (int steamAppId) |
| Get game info by Steam App ID. | |
| static std::vector< SteamGridDBImage > | getGridImages (int gameId) |
| Get grid/cover images for a game. | |
| static std::vector< SteamGridDBImage > | getHeroImages (int gameId) |
| Get hero images for a game. | |
| static std::vector< SteamGridDBImage > | getIconImages (int gameId) |
| Get icon images for a game. | |
| static std::vector< SteamGridDBImage > | getLogoImages (int gameId) |
| Get logo images for a game. | |
| static bool | hasApiKey () |
| Check if API key is configured. | |
| static std::vector< SteamGridDBGame > | searchGames (const std::string &query) |
| Search for games by name. | |
| static void | searchGamesAsync (const std::string &query, const std::function< void(const std::vector< SteamGridDBGame > &)> &callback) |
| Search for games by name asynchronously. | |
| static void | setApiKey (const std::string &key) |
| Set the API key for SteamGridDB. | |
Service for fetching game images from SteamGridDB.
Provides methods to search for games and fetch images from SteamGridDB. Requires an API key for full functionality.
Definition at line 109 of file steamgriddb_service.h.
|
static |
Clear all cached images.
Definition at line 838 of file steamgriddb_service.cpp.
References getCacheDirectory(), Logger::info(), and Logger::warn().
|
static |
Download best cover art for a game by name.
| gameName | Name of the game to search for |
This is a convenience method that searches for the game, finds the best rated cover, and downloads it.
Definition at line 718 of file steamgriddb_service.cpp.
References Logger::debug(), downloadImage(), getCachedCover(), getGridImages(), SteamGridDBGame::id, Logger::info(), SteamGridDBGame::name, searchGames(), and Logger::warn().
Referenced by downloadBestCoverAsync().
|
static |
Download best cover art asynchronously.
| gameName | Name of the game |
| callback | Function to call with local path (empty on failure) |
Definition at line 786 of file steamgriddb_service.cpp.
References downloadBestCover().
|
static |
Download an image to local cache.
| image | Image to download |
| gameName | Game name (used for filename) |
Definition at line 685 of file steamgriddb_service.cpp.
References Logger::debug(), getCacheDirectory(), SteamGridDBImage::id, Logger::info(), SteamGridDBImage::mime, and SteamGridDBImage::url.
Referenced by SteamGridDBSearchWorker::doDownloadImage(), and downloadBestCover().
|
static |
Get all images for a game.
| gameId | SteamGridDB game ID |
Definition at line 661 of file steamgriddb_service.cpp.
References getGridImages(), getHeroImages(), getIconImages(), getLogoImages(), SteamGridDBImageSet::grids, SteamGridDBImageSet::heroes, SteamGridDBImageSet::icons, Logger::info(), and SteamGridDBImageSet::logos.
|
static |
Check if we have a cached cover for a game.
| gameName | Game name |
Definition at line 801 of file steamgriddb_service.cpp.
References getCacheDirectory().
Referenced by downloadBestCover().
|
static |
Get the cache directory for downloaded images.
Definition at line 74 of file steamgriddb_service.cpp.
References Logger::warn().
Referenced by clearCache(), downloadImage(), getCachedCover(), and getCacheSize().
|
static |
Get total size of cached images in bytes.
Definition at line 861 of file steamgriddb_service.cpp.
References getCacheDirectory().
|
static |
Get game info by Steam App ID.
| steamAppId | Steam App ID |
Definition at line 543 of file steamgriddb_service.cpp.
References Logger::info().
|
static |
Get grid/cover images for a game.
| gameId | SteamGridDB game ID |
Definition at line 580 of file steamgriddb_service.cpp.
Referenced by SteamGridDBSearchWorker::doLoadImages(), downloadBestCover(), and getAllImages().
|
static |
Get hero images for a game.
| gameId | SteamGridDB game ID |
Definition at line 601 of file steamgriddb_service.cpp.
Referenced by SteamGridDBSearchWorker::doLoadImages(), and getAllImages().
|
static |
Get icon images for a game.
| gameId | SteamGridDB game ID |
Definition at line 641 of file steamgriddb_service.cpp.
Referenced by SteamGridDBSearchWorker::doLoadImages(), and getAllImages().
|
static |
Get logo images for a game.
| gameId | SteamGridDB game ID |
Definition at line 621 of file steamgriddb_service.cpp.
Referenced by SteamGridDBSearchWorker::doLoadImages(), and getAllImages().
|
static |
Check if API key is configured.
Definition at line 68 of file steamgriddb_service.cpp.
Referenced by SteamGridDBSelectorDialog::SteamGridDBSelectorDialog().
|
static |
Search for games by name.
| query | Search query (game name) |
Definition at line 498 of file steamgriddb_service.cpp.
References Logger::info(), and Logger::warn().
Referenced by SteamGridDBSearchWorker::doSearch(), downloadBestCover(), and searchGamesAsync().
|
static |
Search for games by name asynchronously.
| query | Search query |
| callback | Function to call with results |
Definition at line 528 of file steamgriddb_service.cpp.
References searchGames().
|
static |
Set the API key for SteamGridDB.
| key | API key from steamgriddb.com |
Without an API key, only limited public endpoints are available.
Definition at line 61 of file steamgriddb_service.cpp.
References Logger::info().