aboutsummaryrefslogtreecommitdiff
path: root/import/src/tmdb.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-09-25 04:00:51 +0200
committermetamuffin <metamuffin@disroot.org>2025-09-25 04:00:51 +0200
commitf8d4c438d10450ead56c0082b037e466ef5f9f24 (patch)
tree703612747f06b91f063dcd9e8a778675e6aa1303 /import/src/tmdb.rs
parent0fe48987c336b9b50cba09355aa3c1cf11740edc (diff)
downloadjellything-f8d4c438d10450ead56c0082b037e466ef5f9f24.tar
jellything-f8d4c438d10450ead56c0082b037e466ef5f9f24.tar.bz2
jellything-f8d4c438d10450ead56c0082b037e466ef5f9f24.tar.zst
start media processing refactor
Diffstat (limited to 'import/src/tmdb.rs')
-rw-r--r--import/src/tmdb.rs19
1 files changed, 9 insertions, 10 deletions
diff --git a/import/src/tmdb.rs b/import/src/tmdb.rs
index ceb1650..ad99fde 100644
--- a/import/src/tmdb.rs
+++ b/import/src/tmdb.rs
@@ -5,7 +5,6 @@
*/
use crate::USER_AGENT;
use anyhow::{anyhow, bail, Context};
-use bincode::{Decode, Encode};
use jellycache::{async_cache_file, async_cache_memory, CachePath};
use jellycommon::{
chrono::{format::Parsed, Utc},
@@ -16,7 +15,7 @@ use reqwest::{
header::{HeaderMap, HeaderName, HeaderValue},
Client, ClientBuilder,
};
-use serde::Deserialize;
+use serde::{Deserialize, Serialize};
use std::sync::Arc;
use tokio::io::AsyncWriteExt;
@@ -165,7 +164,7 @@ pub fn parse_release_date(d: &str) -> anyhow::Result<Option<i64>> {
Ok(Some(p.to_datetime_with_timezone(&Utc)?.timestamp_millis()))
}
-#[derive(Debug, Clone, Deserialize, Encode, Decode)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TmdbEpisode {
pub air_date: String,
pub overview: String,
@@ -177,12 +176,12 @@ pub struct TmdbEpisode {
pub vote_count: usize,
}
-#[derive(Debug, Clone, Deserialize, Encode, Decode)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TmdbPersonImage {
pub id: u64,
pub profiles: Vec<TmdbPersonImageProfile>,
}
-#[derive(Debug, Clone, Deserialize, Encode, Decode)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TmdbPersonImageProfile {
pub aspect_ratio: f64,
pub height: u32,
@@ -190,7 +189,7 @@ pub struct TmdbPersonImageProfile {
pub file_path: String,
}
-#[derive(Debug, Clone, Deserialize, Encode, Decode)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TmdbQuery {
pub page: usize,
pub results: Vec<TmdbQueryResult>,
@@ -198,7 +197,7 @@ pub struct TmdbQuery {
pub total_results: usize,
}
-#[derive(Debug, Clone, Deserialize, Encode, Decode)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TmdbQueryResult {
pub adult: bool,
pub backdrop_path: Option<String>,
@@ -216,7 +215,7 @@ pub struct TmdbQueryResult {
pub vote_count: usize,
}
-#[derive(Debug, Clone, Deserialize, Encode, Decode)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TmdbDetails {
pub adult: bool,
pub backdrop_path: Option<String>,
@@ -240,13 +239,13 @@ pub struct TmdbDetails {
pub tagline: Option<String>,
}
-#[derive(Debug, Clone, Deserialize, Encode, Decode)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TmdbGenre {
pub id: u64,
pub name: String,
}
-#[derive(Debug, Clone, Deserialize, Encode, Decode)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TmdbProductionCompany {
pub id: u64,
pub name: String,