Add uplay syncrhonization

This commit is contained in:
Philip
2022-01-02 10:37:12 +01:00
parent f60a591180
commit dd21e56fd6
36 changed files with 225 additions and 97 deletions
+9 -4
View File
@@ -64,9 +64,10 @@ impl Platform<ItchGame, ItchErrors> for ItchPlatform {
let shortcuts_res = self.get_shortcuts();
match shortcuts_res {
Ok(_) => SettingsValidity::Valid,
Err(err) => SettingsValidity::Invalid{reason:format!("{}",err)}
Err(err) => SettingsValidity::Invalid {
reason: format!("{}", err),
},
}
}
}
@@ -94,7 +95,7 @@ fn dbpath_to_game(paths: &DbPaths<'_>) -> Option<ItchGame> {
#[cfg(target_os = "linux")]
pub fn get_default_location() -> String {
//If we don't have a home drive we have to just die
let home = std::env::var("HOME").expect("Expected a home variable to be defined");
let home = std::env::var("HOME").expect("Expected a home variable to be defined");
format!("{}/.config/itch/", home)
}
@@ -102,7 +103,11 @@ pub fn get_default_location() -> String {
pub fn get_default_location() -> String {
let key = "APPDATA";
let appdata = std::env::var(key).expect("Expected a APPDATA variable to be defined");
Path::new(&appdata).join("itch").to_str().unwrap().to_string()
Path::new(&appdata)
.join("itch")
.to_str()
.unwrap()
.to_string()
//C:\Users\phili\AppData\Local\itch
}
+4 -4
View File
@@ -1,9 +1,9 @@
mod settings;
mod butler_db_parser;
mod itch_game;
mod itch_platform;
mod butler_db_parser;
mod receipt;
mod settings;
pub use settings::*;
pub use itch_game::*;
pub use itch_platform::*;
pub use itch_platform::*;
pub use settings::*;
+4 -4
View File
@@ -1,11 +1,11 @@
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone)]
pub(crate) struct Receipt{
pub game:Game,
pub(crate) struct Receipt {
pub game: Game,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub(crate) struct Game{
pub title:String
pub(crate) struct Game {
pub title: String,
}
+2 -2
View File
@@ -1,4 +1,4 @@
use serde::{Serialize,Deserialize};
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct ItchSettings {
@@ -6,4 +6,4 @@ pub struct ItchSettings {
pub location: Option<String>,
#[cfg(target_os = "linux")]
pub create_symlinks: bool,
}
}