diff --git a/src/api/search.rs b/src/api/search.rs index 54dd645..317fe77 100644 --- a/src/api/search.rs +++ b/src/api/search.rs @@ -1,7 +1,4 @@ -use crate::{ - models::file::FileActions, - Response, VerifiedAuthData, -}; +use crate::{models::file::FileActions, Response, VerifiedAuthData}; use actix_web::{error::ErrorInternalServerError, post}; use actix_web::{web, HttpResponse}; use entity::file::Model as File; diff --git a/src/utils/indexer.rs b/src/utils/indexer.rs index 9ae6544..0a3ae42 100755 --- a/src/utils/indexer.rs +++ b/src/utils/indexer.rs @@ -56,7 +56,7 @@ pub async fn scan_file(file_path: &Path) -> Result { .unwrap_or_default() ); Ok(File { - last_update: chrono::NaiveDateTime::from_timestamp( + last_update: chrono::NaiveDateTime::from_timestamp_opt( metadata .modified() .unwrap() @@ -64,7 +64,8 @@ pub async fn scan_file(file_path: &Path) -> Result { .map_err(|e| e.to_string())? .as_secs() as i64, 0, - ), + ) + .unwrap_or_default(), title: elements .get(anitomy::ElementCategory::AnimeTitle) .map(|e| e.to_string()),