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/infojson.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/infojson.rs')
-rw-r--r-- | import/src/infojson.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/import/src/infojson.rs b/import/src/infojson.rs index c18c19d..e6b001f 100644 --- a/import/src/infojson.rs +++ b/import/src/infojson.rs @@ -5,7 +5,7 @@ */ use anyhow::Context; -use jellycommon::chrono::{format::Parsed, DateTime, Utc}; +use jellycommon::chrono::{format::Parsed, Utc}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; @@ -123,7 +123,7 @@ pub struct YHeatmapSample { pub value: f64, } -pub fn parse_upload_date(d: &str) -> anyhow::Result<DateTime<Utc>> { +pub fn parse_upload_date(d: &str) -> anyhow::Result<i64> { let (year, month, day) = (&d[0..4], &d[4..6], &d[6..8]); let (year, month, day) = ( year.parse().context("parsing year")?, @@ -139,5 +139,5 @@ pub fn parse_upload_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()) } |