1
Fork 0
mirror of https://github.com/redstrate/Auracite.git synced 2025-06-07 16:07:45 +00:00

Move package struct to it's own module

This commit is contained in:
Joshua Goins 2025-03-31 16:09:24 -04:00
parent cfddb17c46
commit fbb6cd26d0
2 changed files with 56 additions and 53 deletions

View file

@ -1,6 +1,7 @@
pub mod data; pub mod data;
pub mod downloader; pub mod downloader;
pub mod html; pub mod html;
pub mod package;
pub mod parser; pub mod parser;
use crate::data::CharacterData; use crate::data::CharacterData;
@ -8,6 +9,7 @@ use crate::downloader::download;
use crate::html::{create_character_html, create_plate_html}; use crate::html::{create_character_html, create_plate_html};
use crate::parser::parse_search; use crate::parser::parse_search;
use base64::prelude::*; use base64::prelude::*;
use package::Package;
use physis::race::{Gender, Race, Tribe}; use physis::race::{Gender, Race, Tribe};
use reqwest::Url; use reqwest::Url;
use serde::Deserialize; use serde::Deserialize;
@ -33,59 +35,6 @@ const IMAGE_HOST: &str = "img2.finalfantasyxiv.com";
/// The image proxy used in WebAssembly builds. Needed for CORS. /// The image proxy used in WebAssembly builds. Needed for CORS.
const IMAGE_TUNNEL_HOST: &str = "img-tunnel.ryne.moe"; const IMAGE_TUNNEL_HOST: &str = "img-tunnel.ryne.moe";
#[derive(Default, Deserialize, Clone)]
struct Package {
playtime: String,
gil: u32,
is_battle_mentor: bool,
is_trade_mentor: bool,
is_novice: bool,
is_returner: bool,
player_commendations: i32,
pub portrait: String,
pub plate_title: String,
pub plate_title_is_prefix: bool,
pub plate_class_job: String,
pub plate_class_job_level: i32,
pub search_comment: String,
pub base_plate: Option<String>,
pub pattern_overlay: Option<String>,
pub backing: Option<String>,
pub top_border: Option<String>,
pub bottom_border: Option<String>,
pub portrait_frame: Option<String>,
pub plate_frame: Option<String>,
pub accent: Option<String>,
// Appearance
pub race: i32,
pub gender: i32,
pub model_type: i32,
pub height: i32,
pub tribe: i32,
pub face_type: i32,
pub hair_style: i32,
pub has_highlights: bool,
pub skin_color: i32,
pub eye_color: i32,
pub hair_color: i32,
pub hair_color2: i32,
pub face_features: i32,
pub face_features_color: i32,
pub eyebrows: i32,
pub eye_color2: i32,
pub eye_shape: i32,
pub nose_shape: i32,
pub jaw_shape: i32,
pub lip_style: i32,
pub lip_color: i32,
pub race_feature_size: i32,
pub race_feature_type: i32,
pub bust_size: i32,
pub facepaint: i32,
pub facepaint_color: i32,
}
#[derive(Debug)] #[derive(Debug)]
pub enum ArchiveError { pub enum ArchiveError {
DownloadFailed(String), DownloadFailed(String),

54
src/package.rs Normal file
View file

@ -0,0 +1,54 @@
use serde::Deserialize;
#[derive(Default, Deserialize, Clone)]
pub struct Package {
pub playtime: String,
pub gil: u32,
pub is_battle_mentor: bool,
pub is_trade_mentor: bool,
pub is_novice: bool,
pub is_returner: bool,
pub player_commendations: i32,
pub portrait: String,
pub plate_title: String,
pub plate_title_is_prefix: bool,
pub plate_class_job: String,
pub plate_class_job_level: i32,
pub search_comment: String,
pub base_plate: Option<String>,
pub pattern_overlay: Option<String>,
pub backing: Option<String>,
pub top_border: Option<String>,
pub bottom_border: Option<String>,
pub portrait_frame: Option<String>,
pub plate_frame: Option<String>,
pub accent: Option<String>,
// Appearance
pub race: i32,
pub gender: i32,
pub model_type: i32,
pub height: i32,
pub tribe: i32,
pub face_type: i32,
pub hair_style: i32,
pub has_highlights: bool,
pub skin_color: i32,
pub eye_color: i32,
pub hair_color: i32,
pub hair_color2: i32,
pub face_features: i32,
pub face_features_color: i32,
pub eyebrows: i32,
pub eye_color2: i32,
pub eye_shape: i32,
pub nose_shape: i32,
pub jaw_shape: i32,
pub lip_style: i32,
pub lip_color: i32,
pub race_feature_size: i32,
pub race_feature_type: i32,
pub bust_size: i32,
pub facepaint: i32,
pub facepaint_color: i32,
}