1#![allow(clippy::upper_case_acronyms)]
2
3use std::sync::Arc;
4
5use language_tags::LanguageTag;
6use serde::{Deserialize, Serialize};
7
8use super::{character::Character, staff::Staff, studio::Studio};
9
10#[derive(Debug, Serialize, Deserialize)]
11pub enum Entry {
12 Anime {
13 id: u64,
16 titles: Titles,
18 anime_type: AnimeType,
20 total_episodes: Option<u32>,
22 aired_episodes: u32,
24 description: String,
26 source: Source,
28 characters: Vec<Character>,
30 openings: Vec<EntrySong>,
32 endings: Vec<EntrySong>,
34 staff: Vec<Staff>,
36 studios: Vec<Studio>,
38 links: Vec<Link>,
41 pv_yt_id: String,
43 },
44 Manga {
45 id: u64,
48 titles: Titles,
49 total_chapters: Option<u32>,
50 published_chapters: u32,
51 description: String,
52 characters: Vec<Character>,
53 staff: Vec<Staff>,
54 links: Vec<Link>,
55 },
56}
57
58#[derive(Debug, Serialize, Deserialize)]
59pub struct Titles {
60 native: Option<String>,
62 romaji: Option<String>,
65 localized: Vec<(LanguageTag, String)>,
68 abbreviated: Vec<String>,
70 other: Vec<String>,
72}
73
74#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
75pub enum AnimeType {
76 TV,
77 Movie,
78 OVA,
79 ONA,
80 Short,
81}
82
83#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
84pub enum Source {
85 Manga,
86 LightNovel,
87 VisualNovel,
88 Original,
89 Novel,
90 VideoGame,
91}
92
93#[derive(Debug, Serialize, Deserialize)]
94pub struct EntrySong {
95 episodes: Vec<u32>,
96 title: Arc<str>,
97 links: Vec<SongLink>,
98}
99
100#[derive(Debug, Serialize, Deserialize)]
101pub enum SongLink {
102 Spotify(String),
103 YouTube(String),
104 Tidal(String),
105 AppleMusic(String),
106 AmazonMusic(String),
107 BandCamp(String),
108 Other(String),
109}
110
111#[derive(Debug, Serialize, Deserialize)]
112pub enum Link {
113 PrimeVideo(String),
114 Netflix(String),
115 Crunchyroll(String),
116 OfficialSite(String),
117 Twitter(String),
118 YouTube(String),
119 BilibiliTV(String),
120 Funimation(String),
121 Hulu(String),
122 Max(String),
123 HiDive(String),
124 Wikipedia(String),
125 BookWalker(String),
126 CONtv(String),
127 DisneyPlus(String),
128 Instagram(String),
129 TikTok(String),
130 Other(String),
131}