diff options
Diffstat (limited to 'import/src/tmdb.rs')
-rw-r--r-- | import/src/tmdb.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/import/src/tmdb.rs b/import/src/tmdb.rs index 37447e6..95ebef4 100644 --- a/import/src/tmdb.rs +++ b/import/src/tmdb.rs @@ -5,7 +5,7 @@ */ use anyhow::Context; use bincode::{Decode, Encode}; -use jellycommon::chrono::{format::Parsed, DateTime, Utc}; +use jellycommon::chrono::{format::Parsed, Utc}; use log::info; use serde::Deserialize; @@ -115,7 +115,7 @@ pub async fn tmdb_image(path: &str) -> anyhow::Result<Vec<u8>> { Ok(res.bytes().await?.to_vec()) } -pub fn parse_release_date(d: &str) -> anyhow::Result<DateTime<Utc>> { +pub fn parse_release_date(d: &str) -> anyhow::Result<i64> { let (year, month, day) = (&d[0..4], &d[5..7], &d[8..10]); let (year, month, day) = ( year.parse().context("parsing year")?, @@ -131,5 +131,5 @@ pub fn parse_release_date(d: &str) -> anyhow::Result<DateTime<Utc>> { p.hour_mod_12 = Some(0); p.minute = Some(0); p.second = Some(0); - Ok(p.to_datetime_with_timezone(&Utc)?) + Ok(p.to_datetime_with_timezone(&Utc)?.timestamp_millis()) } |