diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-15 22:01:59 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-15 22:01:59 +0100 |
commit | 9d16b171c28c7f7a7020983f28c315b9db2cc20f (patch) | |
tree | 692f07f7e7bef224ae4bd0a6a937b6d09af380ba | |
parent | 7d97c00b1f43613fdb45258665489d5ab62da066 (diff) | |
download | jellything-9d16b171c28c7f7a7020983f28c315b9db2cc20f.tar jellything-9d16b171c28c7f7a7020983f28c315b9db2cc20f.tar.bz2 jellything-9d16b171c28c7f7a7020983f28c315b9db2cc20f.tar.zst |
readded release date import
-rw-r--r-- | import/src/lib.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/import/src/lib.rs b/import/src/lib.rs index 6a725c8..3b74029 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -35,7 +35,7 @@ use std::{ path::{Path, PathBuf}, sync::{Arc, LazyLock}, }; -use tmdb::tmdb_image; +use tmdb::{parse_release_date, tmdb_image}; use tokio::{io::AsyncWriteExt, sync::Semaphore, task::spawn_blocking}; static IMPORT_SEM: LazyLock<Semaphore> = LazyLock::new(|| Semaphore::new(1)); @@ -241,6 +241,10 @@ async fn process_source( node.public .ratings .insert(Rating::Tmdb, details.vote_average); + if let Some(date) = details.release_date.clone() { + node.public.release_date = + Some(parse_release_date(&date).context("parsing release date")?); + } insert_node(&id, node)?; } @@ -358,6 +362,10 @@ async fn process_source( node.public .ratings .insert(Rating::YoutubeViews, infojson.view_count as f64); + node.public.release_date = Some( + infojson::parse_upload_date(&infojson.upload_date) + .context("parsing upload date")?, + ); node.public.ratings.extend( infojson .like_count |