Skip to content

Commit

Permalink
feat: Support capital or lowercase universe key in acf (CEbbinghaus#13)
Browse files Browse the repository at this point in the history
* Support capital or lowercase universe key in acf
* Use `serde_alias` crate on the AppState struct deserialization
  • Loading branch information
jfreuden authored Feb 13, 2024
1 parent 8cc660c commit ce7e0f1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
38 changes: 38 additions & 0 deletions backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ simplelog = "0.12"
once_cell = "1.18.0"
chrono = "0.4.24"
serde_json = "1.0"
serde_alias = "0.0.2"
tokio = { version = "1.26.0", features = ["full"] }
tokio-stream = { version = "0.1.14", features = ["sync"] }
futures = "0.3.26"
Expand Down
9 changes: 7 additions & 2 deletions backend/src/steam.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
use std::fmt::{Debug, Display};

use serde::Deserialize;
use serde_alias::serde_alias;

#[derive(Deserialize, Debug)]
pub struct LibraryFolder {
pub contentid: String,
pub label: String,
}

#[serde_alias(
CamelCase,
PascalCase,
LowerCase,
SnakeCase
)]
#[derive(Deserialize)]
pub struct AppState {
pub appid: String,
pub universe: i32,
pub name: String,
#[serde(rename(deserialize = "StateFlags"))]
pub state_flags: Option<i32>,
pub installdir: String,
#[serde(rename(deserialize = "SizeOnDisk"))]
pub size_on_disk: u64,
}

Expand Down

0 comments on commit ce7e0f1

Please sign in to comment.