Handle folder renames without leaving behind invalid books #188

Closed
opened 2026-04-24 23:00:39 +02:00 by adam · 4 comments
Owner

Originally created by @wtanksleyjr on GitHub (Jan 28, 2022).

When a book-containing folder is renamed, the system seems to almost always mark the old book invalid and create a new book for the renamed folder. It would be nice if some provision could be made for detecting that the apparently new book is actually an existing entry, and somewhat more gracefully rescan it to see what metadata changes are implied.

Some approaches:

  • track inodes (for systems using that of course).
  • drop a UUID filename into the book's folder.
  • Keep a table of recent folder changes for admin/root to review, allowing them to sort, search, mark duplicates, and so on.
Originally created by @wtanksleyjr on GitHub (Jan 28, 2022). When a book-containing folder is renamed, the system seems to almost always mark the old book invalid and create a new book for the renamed folder. It would be nice if some provision could be made for detecting that the apparently new book is actually an existing entry, and somewhat more gracefully rescan it to see what metadata changes are implied. Some approaches: * track inodes (for systems using that of course). * drop a UUID filename into the book's folder. * Keep a table of recent folder changes for admin/root to review, allowing them to sort, search, mark duplicates, and so on.
adam closed this issue 2026-04-24 23:00:40 +02:00
Author
Owner

@wtanksleyjr commented on GitHub (Jan 28, 2022):

(This is an Enhancement, I think. But this is really bad for me, since I am trying to modify an existing HUGE directory folder, and I keep having to nuke-and-restart my audiobookshelf because I accumulate so many dead books that are near duplicates of existing books.)

@wtanksleyjr commented on GitHub (Jan 28, 2022): (This is an Enhancement, I think. But this is really bad for me, since I am trying to modify an existing HUGE directory folder, and I keep having to nuke-and-restart my audiobookshelf because I accumulate so many dead books that are near duplicates of existing books.)
Author
Owner

@advplyr commented on GitHub (Jan 28, 2022):

This should already happen, all the folders and files have their inode values stored.
There can be some issues with inodes. If when renaming the folder it gets put on another drive. From my tests this only happens when adding/removing files on Unraid, but could be possible.
I think there are also issues when using remote file systems. Are you using Unraid? What is your setup?

@advplyr commented on GitHub (Jan 28, 2022): This should already happen, all the folders and files have their inode values stored. There can be some issues with inodes. If when renaming the folder it gets put on another drive. From my tests this only happens when adding/removing files on Unraid, but could be possible. I think there are also issues when using remote file systems. Are you using Unraid? What is your setup?
Author
Owner

@wtanksleyjr commented on GitHub (Jan 28, 2022):

That's good news, I must be doing something wrong in my script then. I'll
debug this from my end, feel free to close this and I'll just reopen or
raise a new more specific issue if I find something absolutely smoking-gun.

(I'm working from an ordinary internal drive, no special FS layers or
anything. In fact I depend on hardlinks elsewhere so I know they work.)

-Wm

On Thu, Jan 27, 2022 at 3:47 PM advplyr @.***> wrote:

This should already happen, all the folders and files have their inode
values stored.
There can be some issues with inodes. If when renaming the folder it gets
put on another drive. From my tests this only happens when adding/removing
files on Unraid, but could be possible.
I think there are also issues when using remote file systems. Are you
using Unraid? What is your setup?


Reply to this email directly, view it on GitHub
https://github.com/advplyr/audiobookshelf/issues/334#issuecomment-1023745313,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAJ7H6JUOYTI34MBB6TI5MLUYHKRLANCNFSM5M7KI5WA
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID:
@.***>

@wtanksleyjr commented on GitHub (Jan 28, 2022): That's good news, I must be doing something wrong in my script then. I'll debug this from my end, feel free to close this and I'll just reopen or raise a new more specific issue if I find something absolutely smoking-gun. (I'm working from an ordinary internal drive, no special FS layers or anything. In fact I depend on hardlinks elsewhere so I know they work.) -Wm On Thu, Jan 27, 2022 at 3:47 PM advplyr ***@***.***> wrote: > This should already happen, all the folders and files have their inode > values stored. > There can be some issues with inodes. If when renaming the folder it gets > put on another drive. From my tests this only happens when adding/removing > files on Unraid, but could be possible. > I think there are also issues when using remote file systems. Are you > using Unraid? What is your setup? > > — > Reply to this email directly, view it on GitHub > <https://github.com/advplyr/audiobookshelf/issues/334#issuecomment-1023745313>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAJ7H6JUOYTI34MBB6TI5MLUYHKRLANCNFSM5M7KI5WA> > . > Triage notifications on the go with GitHub Mobile for iOS > <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> > or Android > <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>. > > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Author
Owner

@advplyr commented on GitHub (Jan 30, 2022):

Sounds good

@advplyr commented on GitHub (Jan 30, 2022): Sounds good
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#188