diff --git a/core/src/api/locations.rs b/core/src/api/locations.rs index d5a0b617f..b8572f481 100644 --- a/core/src/api/locations.rs +++ b/core/src/api/locations.rs @@ -126,7 +126,7 @@ pub(crate) fn mount() -> rspc::RouterBuilder< .join(&object.cas_id) .with_extension("webp"); - object.has_thumbnail = thumb_path.exists(); + object.has_thumbnail = thumb_path.try_exists().unwrap(); } ExplorerItem::Path(Box::new(file_path)) }) diff --git a/core/src/api/tags.rs b/core/src/api/tags.rs index b69238220..50e67522b 100644 --- a/core/src/api/tags.rs +++ b/core/src/api/tags.rs @@ -61,7 +61,7 @@ pub(crate) fn mount() -> RouterBuilder { .join(&object.cas_id) .with_extension("webp"); - object.has_thumbnail = thumb_path.exists(); + object.has_thumbnail = thumb_path.try_exists().unwrap(); ExplorerItem::Object(Box::new(object)) }) diff --git a/core/src/library/library_manager.rs b/core/src/library/library_manager.rs index f21237151..70577b536 100644 --- a/core/src/library/library_manager.rs +++ b/core/src/library/library_manager.rs @@ -93,7 +93,7 @@ impl LibraryManager { }; let db_path = config_path.clone().with_extension("db"); - if !db_path.exists() { + if !db_path.try_exists().unwrap() { println!( "Found library '{}' but no matching database file was found. Skipping...", config_path.display() diff --git a/core/src/location/mod.rs b/core/src/location/mod.rs index 4d5d29551..8621942d4 100644 --- a/core/src/location/mod.rs +++ b/core/src/location/mod.rs @@ -44,7 +44,7 @@ impl LocationCreateArgs { ctx: &LibraryContext, ) -> Result { // check if we have access to this location - if !self.path.exists() { + if !self.path.try_exists().unwrap() { return Err(LocationError::PathNotFound(self.path)); } diff --git a/core/src/node/config.rs b/core/src/node/config.rs index 21d61ef47..92f79cd57 100644 --- a/core/src/node/config.rs +++ b/core/src/node/config.rs @@ -115,7 +115,7 @@ impl NodeConfigManager { async fn read(base_path: &PathBuf) -> Result { let path = Path::new(base_path).join(NODE_STATE_CONFIG_NAME); - match path.exists() { + match path.try_exists().unwrap() { true => { let mut file = File::open(&path)?; let base_config: ConfigMetadata = diff --git a/core/src/object/preview/thumb.rs b/core/src/object/preview/thumb.rs index 49de6d157..2eaeb24bd 100644 --- a/core/src/object/preview/thumb.rs +++ b/core/src/object/preview/thumb.rs @@ -189,7 +189,7 @@ impl StatefulJob for ThumbnailJob { let output_path = data.thumbnail_dir.join(&cas_id).with_extension("webp"); // check if file exists at output path - if !output_path.exists() { + if !output_path.try_exists().unwrap() { info!("Writing {:?} to {:?}", path, output_path); match step.kind { diff --git a/crates/p2p/tunnel/src/bin/generate-env.rs b/crates/p2p/tunnel/src/bin/generate-env.rs index b2de3ca8a..4b3990795 100644 --- a/crates/p2p/tunnel/src/bin/generate-env.rs +++ b/crates/p2p/tunnel/src/bin/generate-env.rs @@ -7,7 +7,7 @@ fn main() { println!("Issuing sdtunnel certificate..."); let env_file = Path::new("./.env"); - if env_file.exists() { + if env_file.try_exists().unwrap() { println!("File '{}' already exists. Exiting...", env_file.display()); return; }