Drew Short
5 years ago
5 changed files with 181 additions and 116 deletions
@ -0,0 +1,8 @@ |
|||||
|
<component name="ProjectDictionaryState"> |
||||
|
<dictionary name="drewshort"> |
||||
|
<words> |
||||
|
<w>anime</w> |
||||
|
<w>animeboxes</w> |
||||
|
</words> |
||||
|
</dictionary> |
||||
|
</component> |
@ -1,117 +1,119 @@ |
|||||
use chrono::DateTime;
|
|
||||
use serde::{Deserialize, Serialize};
|
|
||||
|
pub mod anime_boxes {
|
||||
|
use chrono::DateTime;
|
||||
|
use serde::{Deserialize, Serialize};
|
||||
|
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
|
||||
#[serde(deny_unknown_fields)]
|
|
||||
pub struct AnimeBoxesBackup {
|
|
||||
#[serde(rename(serialize = "backupTime", deserialize = "backupTime"))]
|
|
||||
backup_time: DateTime<chrono::Utc>,
|
|
||||
#[serde(rename(serialize = "backupVersion", deserialize = "backupVersion"))]
|
|
||||
backup_version: String,
|
|
||||
#[serde(rename(serialize = "bannedTags", deserialize = "bannedTags"))]
|
|
||||
banned_tags: Vec<String>,
|
|
||||
#[serde(rename(serialize = "creatorName", deserialize = "creatorName"))]
|
|
||||
creator_name: String,
|
|
||||
#[serde(rename(serialize = "creatorVersion", deserialize = "creatorVersion"))]
|
|
||||
creator_version: String,
|
|
||||
favorites: Vec<AnimeBoxesFavorite>,
|
|
||||
#[serde(rename(serialize = "searchHistory", deserialize = "searchHistory"))]
|
|
||||
search_history: Vec<AnimeBoxesSearch>,
|
|
||||
servers: Vec<AnimeBoxesServer>,
|
|
||||
}
|
|
||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
#[serde(deny_unknown_fields)]
|
||||
|
pub struct Backup {
|
||||
|
#[serde(rename(serialize = "backupTime", deserialize = "backupTime"))]
|
||||
|
pub backup_time: DateTime<chrono::Utc>,
|
||||
|
#[serde(rename(serialize = "backupVersion", deserialize = "backupVersion"))]
|
||||
|
pub backup_version: String,
|
||||
|
#[serde(rename(serialize = "bannedTags", deserialize = "bannedTags"))]
|
||||
|
pub banned_tags: Vec<String>,
|
||||
|
#[serde(rename(serialize = "creatorName", deserialize = "creatorName"))]
|
||||
|
pub creator_name: String,
|
||||
|
#[serde(rename(serialize = "creatorVersion", deserialize = "creatorVersion"))]
|
||||
|
pub creator_version: String,
|
||||
|
pub favorites: Vec<Favorite>,
|
||||
|
#[serde(rename(serialize = "searchHistory", deserialize = "searchHistory"))]
|
||||
|
pub search_history: Vec<Search>,
|
||||
|
pub servers: Vec<Server>,
|
||||
|
}
|
||||
|
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
|
||||
#[serde(deny_unknown_fields)]
|
|
||||
struct AnimeBoxesFavorite {
|
|
||||
#[serde(rename(serialize = "dateAdded", deserialize = "dateAdded"))]
|
|
||||
date_added: DateTime<chrono::Utc>,
|
|
||||
#[serde(rename(serialize = "disableStorage", deserialize = "disableStorage"))]
|
|
||||
disable_storage: bool,
|
|
||||
#[serde(rename(
|
|
||||
serialize = "enforceOriginalImage",
|
|
||||
deserialize = "enforceOriginalImage"
|
|
||||
))]
|
|
||||
enforce_original_image: bool,
|
|
||||
file: AnimeBoxesRemoteResource,
|
|
||||
has_children: bool,
|
|
||||
has_comments: bool,
|
|
||||
has_notes: bool,
|
|
||||
#[serde(rename(serialize = "imageIsVisible", deserialize = "imageIsVisible"))]
|
|
||||
image_is_visible: bool,
|
|
||||
#[serde(rename(serialize = "isFavorite", deserialize = "isFavorite"))]
|
|
||||
is_favorite: bool,
|
|
||||
#[serde(rename(serialize = "isVisible", deserialize = "isVisible"))]
|
|
||||
is_visible: bool,
|
|
||||
jpeg: AnimeBoxesRemoteResource,
|
|
||||
md5: String,
|
|
||||
parent_id: String,
|
|
||||
#[serde(rename(serialize = "ppostId", deserialize = "ppostId"))]
|
|
||||
ppost_id: String,
|
|
||||
#[serde(rename(serialize = "ppostUrl", deserialize = "ppostUrl"))]
|
|
||||
ppost_url: String,
|
|
||||
preview: AnimeBoxesRemoteResource,
|
|
||||
rating: String,
|
|
||||
sample: AnimeBoxesRemoteResource,
|
|
||||
score: i16,
|
|
||||
source: String,
|
|
||||
tag_artist: String,
|
|
||||
tag_character: String,
|
|
||||
tag_copyright: String,
|
|
||||
tag_general: String,
|
|
||||
tags: String,
|
|
||||
}
|
|
||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
#[serde(deny_unknown_fields)]
|
||||
|
pub struct Favorite {
|
||||
|
#[serde(rename(serialize = "dateAdded", deserialize = "dateAdded"))]
|
||||
|
pub date_added: DateTime<chrono::Utc>,
|
||||
|
#[serde(rename(serialize = "disableStorage", deserialize = "disableStorage"))]
|
||||
|
pub disable_storage: bool,
|
||||
|
#[serde(rename(
|
||||
|
serialize = "enforceOriginalImage",
|
||||
|
deserialize = "enforceOriginalImage"
|
||||
|
))]
|
||||
|
pub enforce_original_image: bool,
|
||||
|
pub file: RemoteResource,
|
||||
|
pub has_children: bool,
|
||||
|
pub has_comments: bool,
|
||||
|
pub has_notes: bool,
|
||||
|
#[serde(rename(serialize = "imageIsVisible", deserialize = "imageIsVisible"))]
|
||||
|
pub image_is_visible: bool,
|
||||
|
#[serde(rename(serialize = "isFavorite", deserialize = "isFavorite"))]
|
||||
|
pub is_favorite: bool,
|
||||
|
#[serde(rename(serialize = "isVisible", deserialize = "isVisible"))]
|
||||
|
pub is_visible: bool,
|
||||
|
pub jpeg: RemoteResource,
|
||||
|
pub md5: String,
|
||||
|
pub parent_id: String,
|
||||
|
#[serde(rename(serialize = "ppostId", deserialize = "ppostId"))]
|
||||
|
pub ppost_id: String,
|
||||
|
#[serde(rename(serialize = "ppostUrl", deserialize = "ppostUrl"))]
|
||||
|
pub ppost_url: String,
|
||||
|
pub preview: RemoteResource,
|
||||
|
pub rating: String,
|
||||
|
pub sample: RemoteResource,
|
||||
|
pub score: i16,
|
||||
|
pub source: String,
|
||||
|
pub tag_artist: String,
|
||||
|
pub tag_character: String,
|
||||
|
pub tag_copyright: String,
|
||||
|
pub tag_general: String,
|
||||
|
pub tags: String,
|
||||
|
}
|
||||
|
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
|
||||
#[serde(deny_unknown_fields)]
|
|
||||
struct AnimeBoxesRemoteResource {
|
|
||||
#[serde(rename(serialize = "contentType", deserialize = "contentType"))]
|
|
||||
content_type: i8,
|
|
||||
ext: String,
|
|
||||
height: i16,
|
|
||||
url: String,
|
|
||||
width: i16,
|
|
||||
}
|
|
||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
#[serde(deny_unknown_fields)]
|
||||
|
pub struct RemoteResource {
|
||||
|
#[serde(rename(serialize = "contentType", deserialize = "contentType"))]
|
||||
|
pub content_type: i8,
|
||||
|
pub ext: String,
|
||||
|
pub height: i16,
|
||||
|
pub url: String,
|
||||
|
pub width: i16,
|
||||
|
}
|
||||
|
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
|
||||
#[serde(deny_unknown_fields)]
|
|
||||
struct AnimeBoxesSearch {
|
|
||||
#[serde(rename(serialize = "itemId", deserialize = "itemId"))]
|
|
||||
item_id: i32,
|
|
||||
#[serde(rename(serialize = "searchDate", deserialize = "searchDate"))]
|
|
||||
search_date: DateTime<chrono::Utc>,
|
|
||||
#[serde(rename(serialize = "searchText", deserialize = "searchText"))]
|
|
||||
search_text: String,
|
|
||||
starred: bool,
|
|
||||
}
|
|
||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
#[serde(deny_unknown_fields)]
|
||||
|
pub struct Search {
|
||||
|
#[serde(rename(serialize = "itemId", deserialize = "itemId"))]
|
||||
|
pub item_id: i32,
|
||||
|
#[serde(rename(serialize = "searchDate", deserialize = "searchDate"))]
|
||||
|
pub search_date: DateTime<chrono::Utc>,
|
||||
|
#[serde(rename(serialize = "searchText", deserialize = "searchText"))]
|
||||
|
pub search_text: String,
|
||||
|
pub starred: bool,
|
||||
|
}
|
||||
|
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
|
||||
#[serde(deny_unknown_fields)]
|
|
||||
struct AnimeBoxesServer {
|
|
||||
#[serde(rename(serialize = "apikey", deserialize = "apikey"))]
|
|
||||
api_key: String,
|
|
||||
#[serde(rename(serialize = "isDefault", deserialize = "isDefault"))]
|
|
||||
is_default: bool,
|
|
||||
#[serde(rename(serialize = "isSelected", deserialize = "isSelected"))]
|
|
||||
is_selected: bool,
|
|
||||
password: String,
|
|
||||
#[serde(rename(serialize = "passwordKey", deserialize = "passwordKey"))]
|
|
||||
password_key: String,
|
|
||||
#[serde(rename(serialize = "ratingFilterEnabled", deserialize = "ratingFilterEnabled"))]
|
|
||||
rating_filter_enabled: bool,
|
|
||||
#[serde(rename(serialize = "realURL", deserialize = "realURL"))]
|
|
||||
real_url: String,
|
|
||||
#[serde(rename(serialize = "serverId", deserialize = "serverId"))]
|
|
||||
server_id: i16,
|
|
||||
#[serde(rename(serialize = "serverName", deserialize = "serverName"))]
|
|
||||
server_name: String,
|
|
||||
#[serde(rename(serialize = "type", deserialize = "type"))]
|
|
||||
type_: i16,
|
|
||||
url: String,
|
|
||||
#[serde(rename(
|
|
||||
serialize = "useNativeAutocomplete",
|
|
||||
deserialize = "useNativeAutocomplete"
|
|
||||
))]
|
|
||||
use_native_autocomplete: bool,
|
|
||||
#[serde(rename(serialize = "userName", deserialize = "userName"))]
|
|
||||
user_name: String,
|
|
||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
#[serde(deny_unknown_fields)]
|
||||
|
pub struct Server {
|
||||
|
#[serde(rename(serialize = "apikey", deserialize = "apikey"))]
|
||||
|
pub api_key: String,
|
||||
|
#[serde(rename(serialize = "isDefault", deserialize = "isDefault"))]
|
||||
|
pub is_default: bool,
|
||||
|
#[serde(rename(serialize = "isSelected", deserialize = "isSelected"))]
|
||||
|
pub is_selected: bool,
|
||||
|
pub password: String,
|
||||
|
#[serde(rename(serialize = "passwordKey", deserialize = "passwordKey"))]
|
||||
|
pub password_key: String,
|
||||
|
#[serde(rename(serialize = "ratingFilterEnabled", deserialize = "ratingFilterEnabled"))]
|
||||
|
pub rating_filter_enabled: bool,
|
||||
|
#[serde(rename(serialize = "realURL", deserialize = "realURL"))]
|
||||
|
pub real_url: String,
|
||||
|
#[serde(rename(serialize = "serverId", deserialize = "serverId"))]
|
||||
|
pub server_id: i16,
|
||||
|
#[serde(rename(serialize = "serverName", deserialize = "serverName"))]
|
||||
|
pub server_name: String,
|
||||
|
#[serde(rename(serialize = "type", deserialize = "type"))]
|
||||
|
pub server_type: i16,
|
||||
|
pub url: String,
|
||||
|
#[serde(rename(
|
||||
|
serialize = "useNativeAutocomplete",
|
||||
|
deserialize = "useNativeAutocomplete"
|
||||
|
))]
|
||||
|
pub use_native_autocomplete: bool,
|
||||
|
#[serde(rename(serialize = "userName", deserialize = "userName"))]
|
||||
|
pub user_name: String,
|
||||
|
}
|
||||
}
|
}
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue