//! Plain Rust data structs that mirror FlatBuffer types. //! //! These are easy to construct from any source (WIT bindgen types, JSON, etc.) //! and are consumed by the builder functions in `builders.rs`. //! //! Note: FlatBuffer primitive fields are non-optional (they default to 0/false). //! Our Data structs follow the same convention — primitive fields are plain //! values, not Option-wrapped. Use 0/empty-string/false for "missing" values. /// Data struct for `Image`. #[derive(Debug, Clone, Default)] pub struct ImageData { pub url: String, pub layout: String, pub width: u32, pub height: u32, pub blurhash: Option, } /// Data struct for `ImageSet`. #[derive(Debug, Clone, Default)] pub struct ImageSetData { pub low: Option, pub medium: Option, pub high: Option, pub backdrop: Option, pub logo: Option, } /// Data struct for `LinkedId`. #[derive(Debug, Clone, Default)] pub struct LinkedIdData { pub source: String, pub id: String, } /// Data struct for `Attr`. #[derive(Debug, Clone, Default)] pub struct AttrData { pub key: String, pub value: String, } /// Data struct for `MediaCard`. #[derive(Debug, Clone, Default)] pub struct MediaCardData { pub id: String, pub title: String, pub kind: u8, pub images: Option, pub original_title: Option, pub tagline: Option, pub year: Option, pub score: u32, pub genres: Vec, pub status: u8, pub content_rating: Option, pub url: Option, pub ids: Vec, pub extra: Vec, } /// Data struct for `CategoryLink`. #[derive(Debug, Clone, Default)] pub struct CategoryLinkData { pub id: String, pub title: String, pub subtitle: Option, pub image: Option, } /// Data struct for `HomeSection`. #[derive(Debug, Clone, Default)] pub struct HomeSectionData { pub id: String, pub title: String, pub subtitle: Option, pub items: Vec, pub next_page: Option, pub layout: Option, pub show_rank: bool, pub categories: Vec, pub extra: Vec, } /// Data struct for `Episode`. #[derive(Debug, Clone, Default)] pub struct EpisodeData { pub id: String, pub title: String, pub number: f64, pub season: f64, pub images: Option, pub description: Option, pub released: Option, pub score: u32, pub url: Option, pub tags: Vec, pub extra: Vec, } /// Data struct for `Season`. #[derive(Debug, Clone, Default)] pub struct SeasonData { pub id: String, pub title: String, pub number: f64, pub year: u32, pub episodes: Vec, } /// Data struct for `Person`. #[derive(Debug, Clone, Default)] pub struct PersonData { pub id: String, pub name: String, pub image: Option, pub role: Option, pub url: Option, } /// Data struct for `MediaInfo`. #[derive(Debug, Clone, Default)] pub struct MediaInfoData { pub id: String, pub title: String, pub kind: u8, pub images: Option, pub original_title: Option, pub description: Option, pub score: u32, pub scored_by: u64, pub year: Option, pub release_date: Option, pub genres: Vec, pub tags: Vec, pub status: u8, pub content_rating: Option, pub seasons: Vec, pub cast: Vec, pub crew: Vec, pub runtime_minutes: u32, pub trailer_url: Option, pub ids: Vec, pub studio: Option, pub country: Option, pub language: Option, pub url: Option, pub extra: Vec, } /// Data struct for `VideoResolution`. #[derive(Debug, Clone, Default)] pub struct VideoResolutionData { pub width: u32, pub height: u32, pub hdr: bool, pub label: Option, } /// Data struct for `VideoTrack`. #[derive(Debug, Clone, Default)] pub struct VideoTrackData { pub resolution: Option, pub url: String, pub mime_type: Option, pub bitrate: u64, pub codecs: Option, } /// Data struct for `SubtitleTrack`. #[derive(Debug, Clone, Default)] pub struct SubtitleTrackData { pub label: Option, pub url: String, pub language: Option, pub format: Option, } /// Data struct for `Server`. #[derive(Debug, Clone, Default)] pub struct ServerData { pub id: String, pub label: Option, pub url: Option, pub priority: u8, pub extra: Vec, } /// Data struct for `StreamSource`. #[derive(Debug, Clone, Default)] pub struct StreamSourceData { pub id: String, pub label: Option, pub format: u8, pub manifest_url: Option, pub videos: Vec, pub subtitles: Vec, pub headers: Vec, pub extra: Vec, }