Closed Nitrousoxide closed 11 months ago
Metadata should not be getting overwritten (with your server settings) unless you have a metadata.json
or metadata.abs
file inside the same folder of your books.
The watcher doesn't run on a schedule, it will only get triggered when it detects a file has been added or removed from a library folder. Then it will only run the scan on the existing book or new book.
There is an issue relating to covers getting re-extracted from audio files on scans which will explain why covers would be reverted https://github.com/advplyr/audiobookshelf/issues/2110. I've already fixed that for the next release. I'm not aware of any other details getting overwritten
I just looked through your logs and it appears you are having an issue with your files changing their inode values. Can you share what OS and file system you are using for your books?
Related issue on inodes https://github.com/advplyr/audiobookshelf/issues/1447 but not the same since those are short inodes having collisions
The container itself is using docker, so whatever base OS that uses.
I have a remote smb/cifs share mounted to the container
volumes:
- /srv/remotemount/Media/Media/Audiobooks:/audiobooks
which points to a Synology network share (and thus is on a BTRFS file system)
Do you have scheduled library scans enabled? When pressing edit on a library and going to schedule
Do you have scheduled library scans enabled? When pressing edit on a library and going to schedule
Yep
I just changed my scan schedule to run now as opposed to midnight and it did nuke all my metadata again. So I think it's that not the watcher. I exported my log out too if you want to see it. 2023-09-28_6cb590d6-567f-4f4d-8f88-9f772f630783.txt
I found and fixed the issue here. This is specific to not storing the metadata file with the item and the reason you were running up against it with all of your media is because your file system is changing the inode value. I'll release the patch for the this over the weekend.
This will resolve the issue of metadata being overwritten but the scanner will still report that all of your media got updated because of that inode change. I don't know much about your specific setup but maybe you can configure some setting so that the inode values don't keep changing?
As a side note, the watcher probably won't work for you because of the network file system. That is why scheduled library scans were added so it's normal, just giving an fyi
Is there a way for the user to switch to storing the metadata with the item? I did try flipping that, but it didn't seem to do anything (at least immediately) so I assume it only does it for new items going forward? If it writes the metadata to the /audiobook file from /metadata at a scheduled time a note in the mouseover might be a good addition. If not bringing up a popup to start the migration might be a good addition.
In my case the faster storage is on the local drive rather than the network share, so I'll probably keep the metadata local to the server for better performance.
I'll turn off scans for the library for now until this update is pushed, and I update for now as a workaround.
The metadata file is written to the new location the next time the details are updated for that book. There is a feature request open I believe for automatically moving everything over. With the upcoming patch it won't matter whether you store it with the items or not so probably best to keep it as you had.
Describe the issue
Every few days I come back to my audiobookshelf docker install to find that it has reverted the entire audiobook database to an unedited state after doing a scan. I believe the "watcher" scan is reverting all book states to whatever metadata can be gleaned from the directory path and any covers that are in the audiobook directory rather than the metadata fields in the database. I have reverted back to a previous database state and turned off the watcher so I guess we'll see if it still repeats.
I'm not sure what the best way to handle this is. I could obviously disable the watcher, and that's probably fine. I'm not trying to initialize a new audiobook instance anymore from existing directory. But if the intention of the watcher is to overwrite existing metadata with file paths info and the content of the actual file directory you probably want flag that toggle with a warning saying it can be destructive to your audiobook library's metadata.
For me this was pretty destructive since it blew out 300+ audiobooks' metadata. Luckily I keep good backups via dupliciti so I could restore a previous day's state before hours of my work managing the metadata were blown out.
Before the metadata was nuked
Here's a snippet of the log as it destroyed it:
After everything was nuked
The server settings
Steps to reproduce the issue
Audiobookshelf version
2.4.3
How are you running audiobookshelf?
Docker