find all installer downloads, not only the first one

This commit is contained in:
Sebastian Hugentobler 2017-03-21 11:32:43 +01:00
parent 7be923459e
commit 3f184ade1f
2 changed files with 21 additions and 19 deletions

View File

@ -7,6 +7,8 @@ It builds on the work of the [unofficial GOG API Documentation](https://gogapido
This is the first time I am building something with rust, so beware :) This is the first time I am building something with rust, so beware :)
**Please note that this is alpha software, you should not trust it.**
# Configuration # Configuration
The configuration file is in the config folder as described by the xdg specification The configuration file is in the config folder as described by the xdg specification
with a prefix of `gog-sync`. with a prefix of `gog-sync`.

View File

@ -311,8 +311,7 @@ impl<'a> Gog<'a> {
for system in systems.keys() { for system in systems.keys() {
for real_downloads in systems.get(system) { for real_downloads in systems.get(system) {
for real_download in real_downloads.as_array() { for real_download in real_downloads.as_array() {
let download = &real_download[0]; for download in real_download {
if !download.is_object() || if !download.is_object() ||
!download.as_object().unwrap().contains_key("manualUrl") { !download.as_object().unwrap().contains_key("manualUrl") {
error!("Skipping an installer for {}", game.title); error!("Skipping an installer for {}", game.title);
@ -337,6 +336,7 @@ impl<'a> Gog<'a> {
} }
} }
} }
}
Ok(game) Ok(game)
} }