Skip to main content

romm_cli/
types.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Deserialize, Serialize)]
4pub struct Firmware {
5    pub id: u64,
6    pub file_name: String,
7    pub file_name_no_tags: String,
8    pub file_name_no_ext: String,
9    pub file_extension: String,
10    pub file_path: String,
11    pub file_size_bytes: u64,
12    pub full_path: String,
13    pub is_verified: bool,
14    pub crc_hash: String,
15    pub md5_hash: String,
16    pub sha1_hash: String,
17    pub missing_from_fs: bool,
18    pub created_at: String,
19    pub updated_at: String,
20}
21
22#[derive(Debug, Clone, Deserialize, Serialize)]
23pub struct Platform {
24    pub id: u64,
25    pub slug: String,
26    pub fs_slug: String,
27    pub rom_count: u64,
28    pub name: String,
29    pub igdb_slug: Option<String>,
30    pub moby_slug: Option<String>,
31    pub hltb_slug: Option<String>,
32    pub custom_name: Option<String>,
33    pub igdb_id: Option<i64>,
34    pub sgdb_id: Option<i64>,
35    pub moby_id: Option<i64>,
36    pub launchbox_id: Option<i64>,
37    pub ss_id: Option<i64>,
38    pub ra_id: Option<i64>,
39    pub hasheous_id: Option<i64>,
40    pub tgdb_id: Option<i64>,
41    pub flashpoint_id: Option<i64>,
42    pub category: Option<String>,
43    pub generation: Option<i64>,
44    pub family_name: Option<String>,
45    pub family_slug: Option<String>,
46    pub url: Option<String>,
47    pub url_logo: Option<String>,
48    pub firmware: Vec<Firmware>,
49    pub aspect_ratio: Option<String>,
50    pub created_at: String,
51    pub updated_at: String,
52    pub fs_size_bytes: u64,
53    pub is_unidentified: bool,
54    pub is_identified: bool,
55    pub missing_from_fs: bool,
56    pub display_name: Option<String>,
57}
58
59#[derive(Debug, Clone, Deserialize, Serialize)]
60pub struct Rom {
61    pub id: u64,
62    pub platform_id: u64,
63    pub platform_slug: Option<String>,
64    pub platform_fs_slug: Option<String>,
65    pub platform_custom_name: Option<String>,
66    pub platform_display_name: Option<String>,
67    pub fs_name: String,
68    pub fs_name_no_tags: String,
69    pub fs_name_no_ext: String,
70    pub fs_extension: String,
71    pub fs_path: String,
72    pub fs_size_bytes: u64,
73    pub name: String,
74    pub slug: Option<String>,
75    pub summary: Option<String>,
76    pub path_cover_small: Option<String>,
77    pub path_cover_large: Option<String>,
78    pub url_cover: Option<String>,
79    pub is_unidentified: bool,
80    pub is_identified: bool,
81}
82
83#[derive(Debug, Clone, Deserialize, Serialize)]
84pub struct RomList {
85    pub items: Vec<Rom>,
86    pub total: u64,
87    pub limit: u64,
88    pub offset: u64,
89}
90
91/// Collection (smart or virtual) from GET /api/collections.
92#[derive(Debug, Clone, Deserialize, Serialize)]
93pub struct Collection {
94    pub id: u64,
95    pub name: String,
96    #[serde(rename = "type")]
97    pub collection_type: Option<String>,
98    pub rom_count: Option<u64>,
99}