mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-02 22:46:56 -05:00
[Bug]: Chapters are not inited correctly on first import #1564
Labels
No labels
authentication
awaiting release
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/audiobookshelf#1564
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yann-papouin on GitHub (Oct 24, 2023).
Describe the issue
If I add a new audiobook with a lot of files (via samba/network), audiobookshelf detect the new folder and start parsing its content even when the copy is still in progress.
At the end of the copy, if I open the chapter tab, I can see that a lot of chapters are missing:

Since audio files are correctly detected, one solution could be to add a callback that would be run to update chapters each time a new audio file is detected and arbitrary this callback should be run only if the diff time between
latest_audiofile_n.mtimeandlatest_audiofile_n-1.mtimeis reasonable (~1min ?).Another solution could be to have an
auto_chapter=trueattribute onbookby default and while chapters have not manually been edited, they are automatically updated by the scanner.Steps to reproduce the issue
Audiobookshelf version
2.4.4
How are you running audiobookshelf?
Docker
@nichwall commented on GitHub (Oct 24, 2023):
This is due to the watcher picking up new files before everyone is copied.
https://github.com/advplyr/audiobookshelf/issues/1362
@advplyr commented on GitHub (Oct 24, 2023):
This is also to do with #2127 because chapters are only set on first scan and are not updated when new files are added.
That will be tricky since we don't have a flag set to tell if a user made manual adjustments to chapters that we shouldn't override
@Hallo951 commented on GitHub (Oct 25, 2023):
I've noticed that too.
Couldn't one simply implement a watcher that monitors whether the copying process is finished or not? Depending on the result, the watcher is then started with a time delay or after the copying process has finished?
@advplyr commented on GitHub (Oct 25, 2023):
@Hallo951 This is already implemented but can be improved. The watcher will wait for 4 seconds after a file is added/removed before it starts the scan process. If another file gets added/removed during those 4 seconds the timer is reset.
The issue here has to do with transferring files to a NFS that is very slow.
I have an idea on how to improve this by polling file size but haven't worked on it yet.
@advplyr commented on GitHub (Oct 25, 2023):
Duplicate of #1362
@ghost commented on GitHub (Dec 21, 2024):
I think I just had this problem... I've Uploaded my personal collection with a slow internet connection and now some books have wrong/missing chapters. I've tried a partial / full scan but the only fix for me seems to be manually which is quite the task. I could delete and add the library but would lose my listening status (?). Is there a workaround?