find all installer downloads, not only the first one
This commit is contained in:
parent
7be923459e
commit
3f184ade1f
@ -1,12 +1,14 @@
|
|||||||
# GOG-SYNC
|
# GOG-SYNC
|
||||||
|
|
||||||
A small tool to synchronize the stuff in a [GOG](https://www.gog.com/)library
|
A small tool to synchronize the stuff in a [GOG](https://www.gog.com/) library
|
||||||
with a local folder.
|
with a local folder.
|
||||||
|
|
||||||
It builds on the work of the [unofficial GOG API Documentation](https://gogapidocs.readthedocs.io/en/latest/).
|
It builds on the work of the [unofficial GOG API Documentation](https://gogapidocs.readthedocs.io/en/latest/).
|
||||||
|
|
||||||
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`.
|
||||||
|
36
src/gog.rs
36
src/gog.rs
@ -311,26 +311,26 @@ 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() ||
|
||||||
|
!download.as_object().unwrap().contains_key("manualUrl") {
|
||||||
|
error!("Skipping an installer for {}", game.title);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if !download.is_object() ||
|
let installer = Installer {
|
||||||
!download.as_object().unwrap().contains_key("manualUrl") {
|
manual_url: String::from(download["manualUrl"]
|
||||||
error!("Skipping an installer for {}", game.title);
|
.as_str()
|
||||||
continue;
|
.unwrap()),
|
||||||
|
version: String::from(download["version"]
|
||||||
|
.as_str()
|
||||||
|
.unwrap_or("")),
|
||||||
|
os: system.clone(),
|
||||||
|
language: String::from(installer_language),
|
||||||
|
};
|
||||||
|
|
||||||
|
game.installers.push(installer);
|
||||||
}
|
}
|
||||||
|
|
||||||
let installer = Installer {
|
|
||||||
manual_url: String::from(download["manualUrl"]
|
|
||||||
.as_str()
|
|
||||||
.unwrap()),
|
|
||||||
version: String::from(download["version"]
|
|
||||||
.as_str()
|
|
||||||
.unwrap_or("")),
|
|
||||||
os: system.clone(),
|
|
||||||
language: String::from(installer_language),
|
|
||||||
};
|
|
||||||
|
|
||||||
game.installers.push(installer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user