diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-20 00:50:20 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-20 00:50:20 +0100 |
commit | 46c251655db7bb3d9aa814b1a5dde85336b0b9b1 (patch) | |
tree | ab0696f2c92e8854ce6aa0737877cc15184bd8b6 /import/src/tmdb.rs | |
parent | 1c37d32a0985ff7390313833345b9299f9f0b196 (diff) | |
download | jellything-46c251655db7bb3d9aa814b1a5dde85336b0b9b1.tar jellything-46c251655db7bb3d9aa814b1a5dde85336b0b9b1.tar.bz2 jellything-46c251655db7bb3d9aa814b1a5dde85336b0b9b1.tar.zst |
replace sled with redb
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()) } |