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