: you can now choose to notify on shorts or not

This commit is contained in:
VC
2024-09-16 09:54:27 +02:00
parent 9b777dcf57
commit ca46d00175
3 changed files with 26 additions and 2 deletions

View File

@@ -19,6 +19,9 @@ pub struct PeerTubeVideo {
pub name: String,
pub uuid: String,
pub description: String,
pub duration: u64,
#[serde(rename = "aspectRatio")]
pub aspect_ratio: Option<f32>,
#[serde(rename = "previewPath")]
pub preview_path: String,
#[serde(rename = "streamingPlaylists")]
@@ -27,6 +30,15 @@ pub struct PeerTubeVideo {
pub channel: PeerTubeVideoChannel,
}
impl PeerTubeVideo {
pub fn is_short(&self) -> bool {
if self.duration < 60 && self.aspect_ratio.is_some_and(|x| x == 0.5625) {
return true;
}
false
}
}
#[derive(Debug, Deserialize)]
pub struct PeerTubeVideoChannel {
pub id: u8,