From cfb3cc9835857cd39ee43e10320ecca4d70fe934 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Sat, 25 May 2024 21:30:08 +0200 Subject: [PATCH] Set last_opened of new sheets to now Makes them appear at the top of the list --- src/sheet_dao.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sheet_dao.rs b/src/sheet_dao.rs index 7162023..a771cd3 100644 --- a/src/sheet_dao.rs +++ b/src/sheet_dao.rs @@ -2,7 +2,6 @@ use crate::{ database::Database, sheet::{I64DateTime, Pdf, Sheet, SheetKind, SheetKindDiscriminants}, }; -use chrono::{DateTime, Utc}; use sqlx::{sqlite::SqliteRow, Row}; use std::path::{Path, PathBuf}; use strum::IntoEnumIterator; @@ -12,7 +11,7 @@ pub async fn insert_file_as_orphan( file: impl AsRef, ) -> sqlx::Result { let pdf = Pdf::try_from(file.as_ref().to_path_buf()).unwrap(); - let last_opened = DateTime::::default(); + let last_opened = chrono::offset::Utc::now(); let result = sqlx::query( "