From 991c8d737cb09c11c4acc24ba5fd194f57dc3812 Mon Sep 17 00:00:00 2001 From: Exverge Date: Fri, 29 Mar 2024 17:48:13 -0400 Subject: [PATCH] Add build date --- .gitignore | 3 ++- src/main.rs | 2 +- src/serialize.rs | 20 +++++++++++--------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index d6c836f..7acc84c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /target /Cargo.lock src/US.en.json -.idea \ No newline at end of file +.idea +.DS_Store \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index bfcc19e..504b1e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,7 +40,7 @@ fn main() -> anyhow::Result<()> { println!("{}", serde_json::to_string_pretty(&serialize::Game { name: result.title.clone(), description: eshop.get(&eshop_id).unwrap().get("description").unwrap().as_str().unwrap().to_string(), - titleId: title_id, + title_id, img: eshop.get(&eshop_id).unwrap().get("iconUrl").unwrap().as_str().unwrap().to_string(), tests: result.testcases.iter().map(|x| serialize::testcase_to_test(x)).collect(), }).unwrap()); diff --git a/src/serialize.rs b/src/serialize.rs index c452459..36aa47b 100644 --- a/src/serialize.rs +++ b/src/serialize.rs @@ -5,21 +5,22 @@ use crate::{OS, TestCase}; pub struct Game { pub(crate) name: String, pub(crate) description: String, - pub(crate) titleId: String, + pub(crate) title_id: String, pub(crate) img: String, pub(crate) tests: Vec, } #[derive(Serialize, Deserialize)] pub struct Test { - pub(crate) tester: Option, - pub(crate) rating: i8, - pub(crate) details: Option, - pub(crate) cpu: String, - pub(crate) gpu: String, - pub(crate) version: String, - pub(crate) os: String, - pub(crate) from_yuzu: bool, + pub tester: Option, + pub rating: i8, + pub details: Option, + pub test_date: String, + pub cpu: String, + pub gpu: String, + pub version: String, + pub os: String, + pub from_yuzu: bool, } pub fn testcase_to_test(case: &TestCase) -> Test { @@ -35,6 +36,7 @@ pub fn testcase_to_test(case: &TestCase) -> Test { _ => unreachable!() }, details: None, + test_date: case.date.clone(), cpu: case.cpu.clone(), gpu: case.gpu.clone(), version: case.version.clone(),