1
Fork 0

Add doc comments to video structs.

This commit is contained in:
Bauke 2023-01-16 21:31:13 +01:00
parent 27d913a4cb
commit f4fce844ca
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
1 changed files with 21 additions and 0 deletions

View File

@ -11,26 +11,47 @@ mod filters;
#[derive(Debug, Template)] #[derive(Debug, Template)]
#[template(path = "video.html")] #[template(path = "video.html")]
pub struct VideoTemplate { pub struct VideoTemplate {
/// The title of the page.
pub page_title: String, pub page_title: String,
/// Markdown rendered by [`comrak`].
pub rendered_markdown: String, pub rendered_markdown: String,
/// Data for a speedrun video.
pub speedrun: Option<SpeedrunData>, pub speedrun: Option<SpeedrunData>,
/// The YouTube video ID.
pub video_id: String, pub video_id: String,
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct VideoData { pub struct VideoData {
/// The YouTube video ID.
pub id: String, pub id: String,
/// The title of the page.
pub page_title: String, pub page_title: String,
/// Data for a speedrun video.
pub speedrun: Option<SpeedrunData>, pub speedrun: Option<SpeedrunData>,
/// Tags for the video.
#[serde(default)] #[serde(default)]
pub tags: Vec<String>, pub tags: Vec<String>,
} }
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct SpeedrunData { pub struct SpeedrunData {
/// Video chapters as with timestamps and chapter titles.
pub chapters: Option<Vec<(String, String)>>, pub chapters: Option<Vec<(String, String)>>,
/// A link to the entry for this specific speedrun.
pub entry: String, pub entry: String,
/// A link to the leaderboard for this speedrun's category.
pub leaderboard: String, pub leaderboard: String,
/// Deep Rock Galactic mods used in the run.
pub mods: Option<Vec<String>>, pub mods: Option<Vec<String>>,
} }