mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-10-04 02:33:33 +10:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user