[photosd] Fix automatic move to uncategorized on watch folder deletions (#2092)

This was a regression introduced in 1.7.0. On deleting a file on disk,
the corresponding items are supposed to move to uncategorized.

> And if a file is deleted locally, then the corresponding Ente file
will also be automatically moved to uncategorized.
>
> https://help.ente.io/photos/features/watch-folders
This commit is contained in:
Manav Rathi
2024-06-11 10:14:54 +05:30
committed by GitHub
2 changed files with 7 additions and 4 deletions

View File

@@ -4,6 +4,8 @@
- Remember the window size across app restarts.
- Revert changes to the Linux icon.
- Fix an issue where deleted items in watched folders would not move to
uncategorized.
## v1.7.0

View File

@@ -270,10 +270,11 @@ class FolderWatcher {
}
const [removed, rest] = watch.syncedFiles.reduce(
([removed, rest], { path }) => {
(event.filePaths.includes(path) ? rest : removed).push(
watch,
);
([removed, rest], syncedFile) => {
(event.filePaths.includes(syncedFile.path)
? removed
: rest
).push(syncedFile);
return [removed, rest];
},
[[], []],