aboutsummaryrefslogtreecommitdiff
path: root/import/src/infojson.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-30 14:39:20 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-30 14:39:20 +0100
commit02bbb2741f2c463aadf9d07493ebaeac1d73c11a (patch)
tree07cfa4b5ba03bb992b745ff9339c69dc03fca9e9 /import/src/infojson.rs
parent570f24c99af8c9cd1b9050564c32adb85e2c9c0f (diff)
downloadjellything-02bbb2741f2c463aadf9d07493ebaeac1d73c11a.tar
jellything-02bbb2741f2c463aadf9d07493ebaeac1d73c11a.tar.bz2
jellything-02bbb2741f2c463aadf9d07493ebaeac1d73c11a.tar.zst
import channel and children
Diffstat (limited to 'import/src/infojson.rs')
-rw-r--r--import/src/infojson.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/import/src/infojson.rs b/import/src/infojson.rs
index c2ae305..3e4667e 100644
--- a/import/src/infojson.rs
+++ b/import/src/infojson.rs
@@ -3,13 +3,13 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2025 metamuffin <metamuffin.org>
*/
-
use anyhow::Context;
+use bincode::{Decode, Encode};
use jellycommon::chrono::{format::Parsed, Utc};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
-#[derive(Debug, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)]
pub struct YVideo {
pub id: String,
pub title: String,
@@ -63,7 +63,7 @@ pub struct YVideo {
pub epoch: usize,
}
-#[derive(Debug, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)]
pub struct YCaption {
pub url: Option<String>,
pub ext: String, //"vtt" | "json3" | "srv1" | "srv2" | "srv3" | "ttml",
@@ -71,7 +71,7 @@ pub struct YCaption {
pub name: Option<String>,
}
-#[derive(Debug, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)]
pub struct YFormat {
pub format_id: String,
pub format_note: Option<String>,
@@ -96,13 +96,13 @@ pub struct YFormat {
pub format: String,
}
-#[derive(Debug, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)]
pub struct YFragment {
pub url: Option<String>,
pub duration: Option<f64>,
}
-#[derive(Debug, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)]
pub struct YThumbnail {
pub url: String,
pub preference: Option<i32>,
@@ -112,14 +112,14 @@ pub struct YThumbnail {
pub resolution: Option<String>,
}
-#[derive(Debug, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)]
pub struct YChapter {
pub start_time: f64,
pub end_time: f64,
pub title: String,
}
-#[derive(Debug, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode)]
pub struct YHeatmapSample {
pub start_time: f64,
pub end_time: f64,