Bump to 0.3.1 and format/clippy

This commit is contained in:
Cameron
2025-12-01 13:03:28 -05:00
parent a7d065aadc
commit f02a858368
9 changed files with 156 additions and 163 deletions

View File

@@ -64,8 +64,8 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
let span_context = opentelemetry::Context::current_with_span(span);
let search_recursively = req.recursive.unwrap_or(false);
if let Some(tag_ids) = &req.tag_ids {
if search_recursively {
if let Some(tag_ids) = &req.tag_ids
&& search_recursively {
let filter_mode = &req.tag_filter_mode.unwrap_or(FilterMode::Any);
info!(
"Searching for tags: {}. With path: '{}' and filter mode: {:?}",
@@ -142,7 +142,6 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
.into_http_internal_err()
.unwrap_or_else(|e| e.error_response());
}
}
match file_system.get_files_for_path(search_path) {
Ok(files) => {
@@ -221,7 +220,7 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
let dirs = files
.iter()
.filter(|&f| f.metadata().map_or(false, |md| md.is_dir()))
.filter(|&f| f.metadata().is_ok_and(|md| md.is_dir()))
.map(|path: &PathBuf| {
let relative = path.strip_prefix(&app_state.base_path).unwrap();
relative.to_path_buf()