refactor: Improvements to src-tauri

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2025-10-12 17:04:27 +11:00
parent 62a2561539
commit 5d22b883d5
16 changed files with 133 additions and 183 deletions

View File

@@ -18,6 +18,12 @@ pub struct FetchGameStruct {
version: Option<GameVersion>,
}
impl FetchGameStruct {
pub fn new(game: Game, status: GameStatusWithTransient, version: Option<GameVersion>) -> Self {
Self { game, status, version }
}
}
#[derive(Serialize, Deserialize, Clone, Debug, Default, Encode, Decode)]
#[serde(rename_all = "camelCase")]
pub struct Game {
@@ -33,6 +39,11 @@ pub struct Game {
m_image_library_object_ids: Vec<String>,
m_image_carousel_object_ids: Vec<String>,
}
impl Game {
pub fn id(&self) -> &String {
&self.id
}
}
#[derive(serde::Serialize, Clone)]
pub struct GameUpdateEvent {
pub game_id: String,