Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Metadata NFO and Covers not saving with library items for eBooks/PDFs #2961

Closed
colvdv opened this issue May 9, 2024 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@colvdv
Copy link

colvdv commented May 9, 2024

What happened?

I checked the box for metadata and covers to be stored with the library items but it is only doing so for my audiobook files. I have a library of PDFs also but the metadata doesn't seem to want to relocate itself.

What did you expect to happen?

I expect metadata and covers to be found with the items they belong to, for all library items with metadata.

Steps to reproduce the issue

  1. Create eBook library, fill it with PDFs.
  2. Edit metadata and covers for PDFs.
  3. Toggle On "Store covers with item" and "Store metadata with item".
  4. Refresh everything and patiently wait for it to move items, but it doesn't ever move them.

Audiobookshelf version

v2.9.0

How are you running audiobookshelf?

Windows Tray App

What OS is your Audiobookshelf server hosted from?

Windows

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

No response

Additional Notes

No response

@colvdv colvdv added the bug Something isn't working label May 9, 2024
@nichwall
Copy link
Contributor

nichwall commented May 9, 2024

The metadata is not moved automatically. Right now you will need to enable the "Store with..." settings first. The metadata files are written when the item is modified in ABS, so if the setting is enabled when you modify things, it will be saved with the media.

A tool to move the metadata and covers between the two locations is planned.

@colvdv
Copy link
Author

colvdv commented May 10, 2024

I made changes to a few files shortly after receiving your reply but I am still not seeing metadata or cover files being added to the item location. This is for my eBooks library which contains only PDFs and I have all of them in the same folder since I can edit metadata for individual book files within ABS easily and it organizes how I'd like, not sure if that matters.

A tool for moving these would be excellent. I am planning a switch from Windows to Linux soon and am thus preparing as best I can now for the changeover, organizing metadata and covers is a must!

@advplyr
Copy link
Owner

advplyr commented May 10, 2024

@colvdv Have you tried making a change inside Abs to see if it creates the metadata file? For example, add a random tag to one of the books that doesn't have a metadata file and see if it creates one in the book folder.

The cover isn't going to be moved unless you remove the cover from inside Abs and add it again.

@advplyr advplyr added waiting Waiting for OP unable to reproduce Issue is not yet reproducible labels May 10, 2024
@colvdv
Copy link
Author

colvdv commented May 11, 2024

@colvdv Have you tried making a change inside Abs to see if it creates the metadata file? For example, add a random tag to one of the books that doesn't have a metadata file and see if it creates one in the book folder.

Yes, I made changes earlier and again just now with the tags, but I'm not seeing any metadata files appear. For audiobooks yes, it is working. But for my PDF library is where I am having troubles.

@advplyr
Copy link
Owner

advplyr commented May 11, 2024

Can you enable debug logs and make another edit in Abs for that book? If you watch the logs you will see debug logs about the update you made and then about it saving metadata to a file location. That file location is what we need to know about.

@colvdv
Copy link
Author

colvdv commented May 11, 2024

Can you enable debug logs and make another edit in Abs for that book? If you watch the logs you will see debug logs about the update you made and then about it saving metadata to a file location. That file location is what we need to know about.

2024-05-11 12:32:46.081

DEBUG

[BookMetadata] Key updated genres Personal Development

2024-05-11 12:32:46.081

DEBUG

[LibraryItemController] Updated library item media Transcending the Levels of Consciousness

2024-05-11 12:32:46.103

DEBUG

[LibraryItem] Success saving abmetadata to "E:_SYSTEM\Audiobookshelf\metadata\items\d6c78d3b-923c-4942-a239-c65619513731\metadata.json"

2024-05-11 12:32:46.122

DEBUG

[LibraryItem] "Transcending the Levels of Consciousness" book.genres updated from to Personal Development

2024-05-11 12:32:46.162

DEBUG

[ApiCacheManager] book.afterUpdate: Clearing cache

2024-05-11 12:32:46.163

DEBUG

[LibraryItem] "Transcending the Levels of Consciousness" updatedAt updated from 1715452274677 to 1715452366081

2024-05-11 12:32:46.224

DEBUG

[ApiCacheManager] libraryItem.afterUpdate: Clearing cache

2024-05-11 12:32:46.225

INFO

[LibraryItem] Library item "d6c78d3b-923c-4942-a239-c65619513731" updated

I can see where it is going, but it isn't going where I want it to.

@advplyr
Copy link
Owner

advplyr commented May 14, 2024

Are the PDFs in sub-folders? If the PDF is in the library root folder it isn't going to put the metadata.json files there

@colvdv
Copy link
Author

colvdv commented May 14, 2024

Are the PDFs in sub-folders? If the PDF is in the library root folder it isn't going to put the metadata.json files there

No sub-folders, no. I have all of them in one folder, which is the library folder.

How might I go about moving them while keeping the metadata and covers? If I change the library directory I lose the metadata, that's the issue I'm experiencing.

@advplyr
Copy link
Owner

advplyr commented May 15, 2024

Moving the file into a subfolder should keep it the same item because it uses the inode value of the file. If you are using a network file system that isn't assigning inode values properly then you will have to remove the item from Abs and re-add it once it is in a subdirectory.
Moving a file from the root library folder to a sub-folder was fixed in #2773. The original bug report was #2767

@advplyr advplyr closed this as completed May 15, 2024
@advplyr advplyr removed waiting Waiting for OP unable to reproduce Issue is not yet reproducible labels May 15, 2024
@colvdv
Copy link
Author

colvdv commented May 18, 2024

Moving the file into a subfolder should keep it the same item because it uses the inode value of the file. If you are using a network file system that isn't assigning inode values properly then you will have to remove the item from Abs and re-add it once it is in a subdirectory.

Do I need folders for each book PDF, or would just author folders work with all PDFs from that author in the same folder?

@nichwall
Copy link
Contributor

Do I need folders for each book PDF, or would just author folders work with all PDFs from that author in the same folder?

All library items need to be in their own folder unless they are in the root folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants