What Went Wrong?
When sidecar files exist, a Metadata Update that changes the folder does not delete the source location, even though it becomes empty.
How Can We Reproduce This?
- library organization set to "book per folder" (unsure if this is relevant)
- set metadata to not write sidecar files and to auto-move on update.
- update a book's metadata that will move file to a new folder (eg change author)
- see in logs
o.booklore.service.file.FileMoveHelper : Deleted empty directory and see dir is gone.
- change metadata settings to write sidecar files.
- export sidecar files so they exist in dir.
- update a book's metadata so that it requires a folder change.
- don't see Deleted empty directory message in logs. Old dir still exists in library, but it's empty.
What Should Have Happened?
The empty folder should be cleaned up.
Screenshots or Error Messages (Optional)
Logs
Without sidecar files, changing author "Mary Wollstonecraft Shelley" -> "Mary Shelley"
grimmory | 2026-04-12T09:18:08.473-04:00 INFO 1 --- [booklore-api] [cat-handler-916] o.b.s.m.writer.EpubMetadataWriter : Metadata updated in EPUB: Frankenstein; or, the modern prometheus - Mary Wollstonecraft Shelley (1818).epub
grimmory | 2026-04-12T09:18:08.503-04:00 INFO 1 --- [booklore-api] [cat-handler-916] o.booklore.service.file.FileMoveService : Files for book ID 649 need to be moved to match library pattern
grimmory | 2026-04-12T09:18:08.621-04:00 INFO 1 --- [booklore-api] [cat-handler-916] o.booklore.service.file.FileMoveHelper : Moving file from /books/redacted/Mary Wollstonecraft Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Wollstonecraft Shelley (1818).epub to temporary location /books/redacted/Mary Wollstonecraft Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Wollstonecraft Shelley (1818).epub.tmp_move
grimmory | 2026-04-12T09:18:08.624-04:00 INFO 1 --- [booklore-api] [cat-handler-916] o.booklore.service.file.FileMoveHelper : Committing move from temporary location /books/redacted/Mary Wollstonecraft Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Wollstonecraft Shelley (1818).epub.tmp_move to /books/redacted/Mary Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Shelley (1818).epub
grimmory | 2026-04-12T09:18:08.735-04:00 INFO 1 --- [booklore-api] [cat-handler-916] o.booklore.service.file.FileMoveHelper : Deleted empty directory: /books/redacted/Mary Wollstonecraft Shelley/Frankenstein; or, the modern prometheus
grimmory | 2026-04-12T09:18:08.738-04:00 INFO 1 --- [booklore-api] [cat-handler-916] o.booklore.service.file.FileMoveHelper : Deleted empty directory: /books/redacted/Mary Wollstonecraft Shelley
grimmory | 2026-04-12T09:18:09.654-04:00 INFO 1 --- [booklore-api] [cat-handler-916] o.b.s.monitoring.LibraryWatchService : Registered 665 folders for library 'redacted'
grimmory | 2026-04-12T09:18:11.476-04:00 INFO 1 --- [booklore-api] [ virtual-36] o.b.s.watcher.LibraryFileEventProcessor : [PROCESS] 'ENTRY_CREATE' event for 'Frankenstein; or, the modern prometheus - Mary Wollstonecraft Shelley (1818).epub'
With sidecar files, changing author "Mary Shelley" -> "Mary Wollstonecraft Shelley"
because sidecar, folder's not empty and is retained.
grimmory | 2026-04-12T09:22:19.475-04:00 INFO 1 --- [booklore-api] [cat-handler-968] o.b.s.m.writer.EpubMetadataWriter : Metadata updated in EPUB: Frankenstein; or, the modern prometheus - Mary Shelley (1818).epub
grimmory | 2026-04-12T09:22:19.537-04:00 INFO 1 --- [booklore-api] [cat-handler-968] o.b.s.m.sidecar.SidecarMetadataWriter : Wrote cover file to: /books/redacted/Mary Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Shelley (1818).cover.jpg
grimmory | 2026-04-12T09:22:19.541-04:00 INFO 1 --- [booklore-api] [cat-handler-968] o.b.s.m.sidecar.SidecarMetadataWriter : Wrote sidecar metadata to: /books/redacted/Mary Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Shelley (1818).metadata.json
grimmory | 2026-04-12T09:22:19.543-04:00 INFO 1 --- [booklore-api] [cat-handler-968] o.booklore.service.file.FileMoveService : Files for book ID 649 need to be moved to match library pattern
grimmory | 2026-04-12T09:22:19.734-04:00 INFO 1 --- [booklore-api] [cat-handler-968] o.booklore.service.file.FileMoveHelper : Moving file from /books/redacted/Mary Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Shelley (1818).epub to temporary location /books/redacted/Mary Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Shelley (1818).epub.tmp_move
grimmory | 2026-04-12T09:22:19.738-04:00 INFO 1 --- [booklore-api] [cat-handler-968] o.booklore.service.file.FileMoveHelper : Committing move from temporary location /books/redacted/Mary Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Shelley (1818).epub.tmp_move to /books/redacted/Mary Wollstonecraft Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Wollstonecraft Shelley (1818).epub
grimmory | 2026-04-12T09:22:19.830-04:00 INFO 1 --- [booklore-api] [cat-handler-968] o.b.s.m.sidecar.SidecarMetadataWriter : Moved sidecar file from /books/redacted/Mary Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Shelley (1818).metadata.json to /books/redacted/Mary Wollstonecraft Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Wollstonecraft Shelley (1818).metadata.json
grimmory | 2026-04-12T09:22:19.831-04:00 INFO 1 --- [booklore-api] [cat-handler-968] o.b.s.m.sidecar.SidecarMetadataWriter : Moved sidecar cover from /books/redacted/Mary Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Shelley (1818).cover.jpg to /books/redacted/Mary Wollstonecraft Shelley/Frankenstein; or, the modern prometheus/Frankenstein; or, the modern prometheus - Mary Wollstonecraft Shelley (1818).cover.jpg
grimmory | 2026-04-12T09:22:20.688-04:00 INFO 1 --- [booklore-api] [cat-handler-968] o.b.s.monitoring.LibraryWatchService : Registered 667 folders for library 'redacted'
grimmory | 2026-04-12T09:22:22.479-04:00 INFO 1 --- [booklore-api] [ virtual-36] o.b.s.watcher.LibraryFileEventProcessor : [PROCESS] 'ENTRY_CREATE' event for 'Frankenstein; or, the modern prometheus - Mary Shelley (1818).epub'
Any Ideas on How to Fix This? (Optional)
I think fileMoveHelper.deleteEmptyParentDirsUpToLibraryFolders(sourceParent, libraryRoots); needs to be moved after sidecarMetadataWriter.moveSidecarFiles(currentPrimaryFilePath, newFilePath); to ensure the dir is empty, but I don't have a dev env setup to verify this.
Your Setup
Grimmory 2.3.0 docker
Before Submitting
What Went Wrong?
When sidecar files exist, a Metadata Update that changes the folder does not delete the source location, even though it becomes empty.
How Can We Reproduce This?
o.booklore.service.file.FileMoveHelper : Deleted empty directoryand see dir is gone.What Should Have Happened?
The empty folder should be cleaned up.
Screenshots or Error Messages (Optional)
Logs
Without sidecar files, changing author "Mary Wollstonecraft Shelley" -> "Mary Shelley"
With sidecar files, changing author "Mary Shelley" -> "Mary Wollstonecraft Shelley"
because sidecar, folder's not empty and is retained.
Any Ideas on How to Fix This? (Optional)
I think
fileMoveHelper.deleteEmptyParentDirsUpToLibraryFolders(sourceParent, libraryRoots);needs to be moved aftersidecarMetadataWriter.moveSidecarFiles(currentPrimaryFilePath, newFilePath);to ensure the dir is empty, but I don't have a dev env setup to verify this.Your Setup
Grimmory 2.3.0 docker
Before Submitting