diff --git a/crates/tanoshi/src/infrastructure/domain/repositories/download.rs b/crates/tanoshi/src/infrastructure/domain/repositories/download.rs index 3e2ba9bd..a999154b 100644 --- a/crates/tanoshi/src/infrastructure/domain/repositories/download.rs +++ b/crates/tanoshi/src/infrastructure/domain/repositories/download.rs @@ -222,7 +222,7 @@ impl DownloadRepository for DownloadRepositoryImpl { .bind(item.rank) .bind(&item.url) .bind(&item.priority) - .bind(item.date_added.timestamp()) + .bind(item.date_added.and_utc().timestamp()) } query.execute(&self.pool as &SqlitePool).await?; diff --git a/crates/tanoshi/src/presentation/graphql/downloads.rs b/crates/tanoshi/src/presentation/graphql/downloads.rs index eb18f1ad..4e5b7ccd 100644 --- a/crates/tanoshi/src/presentation/graphql/downloads.rs +++ b/crates/tanoshi/src/presentation/graphql/downloads.rs @@ -104,7 +104,7 @@ impl DownloadRoot { .get_downloaded_chapters( Utc::now().timestamp(), 1, - e.date_added.timestamp(), + e.date_added.and_utc().timestamp(), e.id, None, Some(1), @@ -117,7 +117,7 @@ impl DownloadRoot { if let Some(e) = edges.last() { has_next_page = !download_svc .get_downloaded_chapters( - e.date_added.timestamp(), + e.date_added.and_utc().timestamp(), e.id, 0, 0, @@ -131,7 +131,7 @@ impl DownloadRoot { let mut connection = Connection::new(has_previous_page, has_next_page); connection.edges.extend(edges.into_iter().map(|e| { Edge::new( - Cursor(e.uploaded.timestamp(), e.id), + Cursor(e.uploaded.and_utc().timestamp(), e.id), Chapter { id: e.id, source_id: e.source_id, diff --git a/crates/tanoshi/src/presentation/graphql/library.rs b/crates/tanoshi/src/presentation/graphql/library.rs index 3552f261..f483069f 100644 --- a/crates/tanoshi/src/presentation/graphql/library.rs +++ b/crates/tanoshi/src/presentation/graphql/library.rs @@ -97,7 +97,7 @@ impl LibraryRoot { claims.sub, Utc::now().timestamp(), 1, - e.uploaded.timestamp(), + e.uploaded.and_utc().timestamp(), e.chapter_id, None, Some(1), @@ -111,7 +111,7 @@ impl LibraryRoot { has_next_page = !library_svc .get_library_recent_updates( claims.sub, - e.uploaded.timestamp(), + e.uploaded.and_utc().timestamp(), e.chapter_id, 0, 0, @@ -126,7 +126,7 @@ impl LibraryRoot { connection.edges.extend( edges .into_iter() - .map(|e| Edge::new(Cursor(e.uploaded.timestamp(), e.chapter_id), e.into())), + .map(|e| Edge::new(Cursor(e.uploaded.and_utc().timestamp(), e.chapter_id), e.into())), ); Ok::<_, Error>(connection) @@ -169,7 +169,7 @@ impl LibraryRoot { .get_history_chapters( claims.sub, Utc::now().timestamp(), - e.read_at.timestamp(), + e.read_at.and_utc().timestamp(), None, Some(1), ) @@ -181,7 +181,7 @@ impl LibraryRoot { let mut has_next_page = false; if let Some(e) = edges.last() { has_next_page = !history_svc - .get_history_chapters(claims.sub, e.read_at.timestamp(), 0, Some(1), None) + .get_history_chapters(claims.sub, e.read_at.and_utc().timestamp(), 0, Some(1), None) .await? .is_empty(); } @@ -190,7 +190,7 @@ impl LibraryRoot { connection.edges.extend( edges .into_iter() - .map(|e| Edge::new(Cursor(e.read_at.timestamp(), e.manga_id), e.into())), + .map(|e| Edge::new(Cursor(e.read_at.and_utc().timestamp(), e.manga_id), e.into())), ); Ok::<_, Error>(connection) diff --git a/crates/tanoshi/src/presentation/graphql/loader.rs b/crates/tanoshi/src/presentation/graphql/loader.rs index 1d7b8785..3f001088 100644 --- a/crates/tanoshi/src/presentation/graphql/loader.rs +++ b/crates/tanoshi/src/presentation/graphql/loader.rs @@ -332,7 +332,7 @@ where .await .map_err(|e| Arc::new(anyhow::anyhow!("{e}")))? .iter() - .group_by(|m| UserTrackerMangaId(user_id, m.manga_id)) + .chunk_by(|m| UserTrackerMangaId(user_id, m.manga_id)) .into_iter() .map(|(key, group)| { (