use serde::Deserialize; #[derive(Deserialize, Debug)] pub struct GalleryTitleInfo { pub english: Option, pub japanese: Option, pub pretty: Option, } #[derive(Deserialize, Debug)] pub struct GalleryImageInfo { pub t: String, pub w: usize, pub h: usize } #[derive(Deserialize, Debug)] pub struct GalleryImagesInfo { pub pages: Vec, pub cover: GalleryImageInfo, pub thumbnail: GalleryImageInfo } #[derive(Deserialize, Debug)] pub struct GalleryTagInfo { pub id: usize, pub r#type: String, pub name: String, pub url: String, pub count: usize } #[derive(Deserialize, Debug)] pub struct GalleryInfoSuccess { pub id: usize, pub media_id: String, pub title: GalleryTitleInfo, pub images: GalleryImagesInfo, pub scanlator: String, pub upload_date: usize, pub tags: Vec, pub num_pages: usize, pub num_favorites: usize } #[derive(Deserialize, Debug)] pub struct GalleryInfoError { pub error: String } #[derive(Deserialize, Debug)] #[serde(untagged)] pub enum GalleryInfo { Info(GalleryInfoSuccess), Error(GalleryInfoError) } #[derive(Deserialize, Debug)] pub struct SearchInfo { pub result: Vec, pub num_pages: usize, pub per_page: usize }