Fix recursive search at the root, cleanup video generation return
This commit is contained in:
12
src/files.rs
12
src/files.rs
@@ -70,7 +70,17 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
||||
.map(|tagged_files| {
|
||||
tagged_files
|
||||
.into_iter()
|
||||
.filter(|f| f.starts_with(&format!("{}/", search_path).to_string()))
|
||||
.filter(|f| {
|
||||
// When searching at the root, everything matches recursively
|
||||
if search_path.trim() == "" { return true; }
|
||||
|
||||
f.starts_with(
|
||||
&format!(
|
||||
"{}/",
|
||||
search_path.strip_suffix('/').unwrap_or_else(|| search_path)
|
||||
),
|
||||
)
|
||||
})
|
||||
.collect::<Vec<String>>()
|
||||
})
|
||||
.inspect(|files| debug!("Found {:?} files", files.len()))
|
||||
|
||||
Reference in New Issue
Block a user