mirror of
https://framagit.org/veretcle/tootube.git
synced 2025-07-20 20:41:17 +02:00
✨: you can now choose to notify on shorts or not
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user