diff --git a/src/data/sources/gog/GOGGame.vala b/src/data/sources/gog/GOGGame.vala index 26ea7753..352ac935 100644 --- a/src/data/sources/gog/GOGGame.vala +++ b/src/data/sources/gog/GOGGame.vala @@ -40,6 +40,7 @@ namespace GameHub.Data.Sources.GOG } } + private bool game_info_updating = false; private bool game_info_updated = false; public GOGGame.default(){} @@ -141,6 +142,9 @@ namespace GameHub.Data.Sources.GOG public override async void update_game_info() { + if(game_info_updating) return; + game_info_updating = true; + update_status(); mount_overlays(); @@ -171,7 +175,11 @@ namespace GameHub.Data.Sources.GOG else icon = image; } - if(game_info_updated) return; + if(game_info_updated) + { + game_info_updating = false; + return; + } is_installable = root != null && root.get_node_type() == Json.NodeType.OBJECT && root.get_object().has_member("is_installable") && root.get_object().get_boolean_member("is_installable"); @@ -275,6 +283,7 @@ namespace GameHub.Data.Sources.GOG update_status(); game_info_updated = true; + game_info_updating = false; } public override async void install() diff --git a/src/data/sources/humble/HumbleGame.vala b/src/data/sources/humble/HumbleGame.vala index 26cc28a0..80192736 100644 --- a/src/data/sources/humble/HumbleGame.vala +++ b/src/data/sources/humble/HumbleGame.vala @@ -26,6 +26,7 @@ namespace GameHub.Data.Sources.Humble { public string order_id; + private bool game_info_updating = false; private bool game_info_updated = false; private bool game_info_refreshed = false; @@ -177,6 +178,9 @@ namespace GameHub.Data.Sources.Humble public override async void update_game_info() { + if(game_info_updating) return; + game_info_updating = true; + update_status(); mount_overlays(); @@ -192,7 +196,11 @@ namespace GameHub.Data.Sources.Humble image = icon; } - if(game_info_updated) return; + if(game_info_updated) + { + game_info_updating = false; + return; + } if(info == null || info.length == 0) { @@ -202,11 +210,23 @@ namespace GameHub.Data.Sources.Humble headers["Cookie"] = @"$(Humble.AUTH_COOKIE)=\"$(token)\";"; var root_node = yield Parser.parse_remote_json_file_async(@"https://www.humblebundle.com/api/v1/order/$(order_id)?ajax=true", "GET", null, headers); - if(root_node == null || root_node.get_node_type() != Json.NodeType.OBJECT) return; + if(root_node == null || root_node.get_node_type() != Json.NodeType.OBJECT) + { + game_info_updating = false; + return; + } var root = root_node.get_object(); - if(root == null) return; + if(root == null) + { + game_info_updating = false; + return; + } var products = root.get_array_member("subproducts"); - if(products == null) return; + if(products == null) + { + game_info_updating = false; + return; + } foreach(var product_node in products.get_elements()) { if(product_node.get_object().get_string_member("machine_name") != id) continue; @@ -216,10 +236,18 @@ namespace GameHub.Data.Sources.Humble } var product_node = Parser.parse_json(info); - if(product_node == null || product_node.get_node_type() != Json.NodeType.OBJECT) return; + if(product_node == null || product_node.get_node_type() != Json.NodeType.OBJECT) + { + game_info_updating = false; + return; + } var product = product_node.get_object(); - if(product == null) return; + if(product == null) + { + game_info_updating = false; + return; + } if(product.has_member("description-text")) { @@ -235,6 +263,7 @@ namespace GameHub.Data.Sources.Humble update_status(); game_info_updated = true; + game_info_updating = false; } private async void update_installers() diff --git a/src/data/sources/steam/SteamGame.vala b/src/data/sources/steam/SteamGame.vala index a7e16e72..f420a952 100644 --- a/src/data/sources/steam/SteamGame.vala +++ b/src/data/sources/steam/SteamGame.vala @@ -27,6 +27,7 @@ namespace GameHub.Data.Sources.Steam { private int metadata_tries = 0; + private bool game_info_updating = false; private bool game_info_updated = false; public bool is_updating { get; set; default = false; } @@ -103,6 +104,9 @@ namespace GameHub.Data.Sources.Steam public override async void update_game_info() { + if(game_info_updating) return; + game_info_updating = true; + update_status(); if(image == null || image == "") @@ -128,7 +132,11 @@ namespace GameHub.Data.Sources.Steam Steam.find_app_install_dir(id, out dir); install_dir = dir; - if(game_info_updated) return; + if(game_info_updated) + { + game_info_updating = false; + return; + } if(info_detailed == null || info_detailed.length == 0) { @@ -152,6 +160,7 @@ namespace GameHub.Data.Sources.Steam debug("[SteamGame] %s: no app data for '%s', store page does not exist", id, name); } game_info_updated = true; + game_info_updating = false; return; } @@ -167,6 +176,7 @@ namespace GameHub.Data.Sources.Steam if(metadata_tries > 0) { game_info_updated = true; + game_info_updating = false; return; } } @@ -187,6 +197,7 @@ namespace GameHub.Data.Sources.Steam platforms.add(Platform.WINDOWS); save(); game_info_updated = true; + game_info_updating = false; return; } @@ -200,8 +211,10 @@ namespace GameHub.Data.Sources.Steam save(); - game_info_updated = true; update_status(); + + game_info_updated = true; + game_info_updating = false; } public override void update_status() diff --git a/src/data/sources/user/UserGame.vala b/src/data/sources/user/UserGame.vala index dde472ad..9f02e914 100644 --- a/src/data/sources/user/UserGame.vala +++ b/src/data/sources/user/UserGame.vala @@ -122,6 +122,7 @@ namespace GameHub.Data.Sources.User var i = Parser.parse_json(info).get_object(); installer = new Installer(this, File.new_for_path(i.get_string_member("installer"))); } + save(); }