Cache fetched games under the key the download agent reads (#490)

fetch_game_logic saves a fetched game under the key "<id>", but the
download agent (and the offline path) look it up under "game/<id>". Only
the library list writes "game/<id>".

So a game that isn't in the user's library - for example an emulator
pulled in as a dependency - is never found in the cache. The download
agent then falls back to the game's id for the folder name and installs
it into <install dir>/<uuid> instead of <install dir>/<name>.
This commit is contained in:
Nate Pelzel
2026-09-05 09:08:29 +10:00
committed by GitHub
parent 9f3d390f0e
commit de19327fad
+2 -2
View File
@@ -248,7 +248,7 @@ pub async fn fetch_game_logic(
let data = FetchGameStruct::new(game.clone(), status, version);
cache_object(&id, &game)?;
cache_object(&format!("game/{}", id), &game)?;
Ok(data)
}
@@ -341,7 +341,7 @@ pub async fn fetch_game_logic_offline(
};
let status = GameStatusManager::fetch_state(&id, &db_handle);
let game = get_cached_object::<Game>(&id)?;
let game = get_cached_object::<Game>(&format!("game/{}", id))?;
drop(db_handle);