Merge branch 'next' of https://github.com/an-anime-team/an-anime-game-launcher
This commit is contained in:
commit
8921ad9891
1 changed files with 6 additions and 1 deletions
|
@ -32,7 +32,12 @@ pub fn get_background_info() -> anyhow::Result<Background> {
|
|||
let uri = json["data"]["game_info_list"].as_array()
|
||||
.ok_or_else(|| anyhow::anyhow!("Failed to list games in the backgrounds API"))?
|
||||
.iter()
|
||||
.find(|game| game["game"]["biz"].as_str() == Some("hkrpg_global"))
|
||||
.find(|game| {
|
||||
match game["game"]["biz"].as_str() {
|
||||
Some(biz) => biz.starts_with("hkrpg_"),
|
||||
_ => false
|
||||
}
|
||||
})
|
||||
.ok_or_else(|| anyhow::anyhow!("Failed to find the game in the backgrounds API"))?["backgrounds"]
|
||||
.as_array()
|
||||
.and_then(|backgrounds| backgrounds.iter().next())
|
||||
|
|
Loading…
Reference in a new issue