use serde::{Deserialize, Serialize};
use crate::ids::{Aid, Bvid, Cid, Mid};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VideoView {
pub aid: Aid,
pub bvid: Bvid,
pub videos: u32,
pub title: String,
pub owner: VideoOwner,
pub stat: VideoStat,
pub cid: Cid,
#[serde(default)]
pub pages: Vec<VideoPage>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VideoDetail {
#[serde(rename = "View")]
pub view: VideoView,
#[serde(default, rename = "Tags")]
pub tags: Vec<VideoTag>,
#[serde(default, rename = "Related")]
pub related: Vec<VideoRelated>,
#[serde(default, rename = "Card")]
pub card: Option<serde_json::Value>,
#[serde(default, rename = "Reply")]
pub reply: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VideoOwner {
pub mid: Mid,
pub name: String,
pub face: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VideoStat {
pub aid: Aid,
pub view: u64,
pub danmaku: u64,
pub reply: u64,
#[serde(default)]
pub favorite: Option<u64>,
#[serde(default)]
pub fav: Option<u64>,
pub coin: u64,
pub share: u64,
pub like: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VideoPage {
pub cid: Cid,
pub page: u32,
pub part: String,
pub duration: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VideoTag {
pub tag_id: u64,
#[serde(default)]
pub tag_name: String,
#[serde(default)]
pub jump_url: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VideoRelated {
pub aid: Aid,
pub bvid: Bvid,
#[serde(default)]
pub title: String,
#[serde(default)]
pub cid: Option<Cid>,
#[serde(default)]
pub owner: Option<VideoOwner>,
#[serde(default)]
pub stat: Option<VideoStat>,
}