All custom metadata changes gone after clearing item cache #2103

Closed
opened 2026-04-25 00:03:30 +02:00 by adam · 5 comments
Owner

Originally created by @xcy7e on GitHub (Jul 13, 2024).

What happened?

All custom metadata changes I made to the 2k items are gone, after clearing item cache.
Like if every item Was rescanned and overwritten with online metadata.

This never happened before, it may have been the night after the newest Update (unsure).

Sadly enough, I also cant restore a Backup (will open another Ticket for this)

My settings:

  • prefer online metadata=Off
  • Auto scan=On
  • metadata are stored centralized, not in the items folder. (though at one point in time, months ago, they were and I cant assure no more old metadata files are still in the items folders)

All items have either an ISBN/ASIN value Set to avoid them being overwritten.

Is this expected behaviour when clearing the Cache?

What did you expect to happen?

Rebuild the item cache (as suggested in the "Manager-Tool"), keeping my custom change to metadata.

Steps to reproduce the issue

  1. Change metadata
  2. Ensure asin/ISBN is set
  3. Disable "prefer online metadata"
  4. Clear item cache

Audiobookshelf version

v2.11.0

How are you running audiobookshelf?

Debian/PPA

What OS is your Audiobookshelf server hosted from?

Linux

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

Originally created by @xcy7e on GitHub (Jul 13, 2024). ### What happened? All custom metadata changes I made to the 2k items are gone, after clearing item cache. Like if every item Was rescanned and overwritten with online metadata. This never happened before, it may have been the night after the newest Update (unsure). Sadly enough, I also cant restore a Backup (will open another Ticket for this) My settings: - `prefer online metadata`=Off - `Auto scan`=On - metadata are stored centralized, not in the items folder. (though at one point in time, months ago, they were and I cant assure no more old metadata files are still in the items folders) All items have either an ISBN/ASIN value Set to avoid them being overwritten. Is this expected behaviour when clearing the Cache? ### What did you expect to happen? Rebuild the item cache (as suggested in the "Manager-Tool"), keeping my custom change to metadata. ### Steps to reproduce the issue 1. Change metadata 2. Ensure asin/ISBN is set 3. Disable "prefer online metadata" 4. Clear item cache ### Audiobookshelf version v2.11.0 ### How are you running audiobookshelf? Debian/PPA ### What OS is your Audiobookshelf server hosted from? Linux ### 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_
adam added the bug label 2026-04-25 00:03:30 +02:00
adam closed this issue 2026-04-25 00:03:30 +02:00
Author
Owner

@nichwall commented on GitHub (Jul 14, 2024):

Metadata is not stored in the /metadata/cache directory. The only data that is stored in /metadata/cache is:

  • cover images of books/podcasts that have been scaled
  • author images that have been scaled
  • backups of media files when using the "Make M4B Tool" to keep the original media in case something goes wrong with the creation

Once you are able to manually restore from a backup (with the server stopped and manually extracting the backup zip and replacing files in /config and /metadata/authors and /metadata/items), can you change your server logs to "Debug" and try clearing the cache again?

Can you also check the library scanner metadata precedence (in library settings under the "Scanner" tab)?

Also, did you press the "Remove metadata" buttons? Since you said the storage location had changed, not sure if you pressed that at all.
image

@nichwall commented on GitHub (Jul 14, 2024): Metadata is not stored in the `/metadata/cache` directory. The only data that is stored in `/metadata/cache` is: - cover images of books/podcasts that have been scaled - author images that have been scaled - backups of media files when using the "Make M4B Tool" to keep the original media in case something goes wrong with the creation Once you are able to manually restore from a backup (with the server stopped and manually extracting the backup zip and replacing files in `/config` and `/metadata/authors` and `/metadata/items`), can you change your server logs to "Debug" and try clearing the cache again? Can you also check the library scanner metadata precedence (in library settings under the "Scanner" tab)? Also, did you press the "Remove metadata" buttons? Since you said the storage location had changed, not sure if you pressed that at all. ![image](https://github.com/user-attachments/assets/f89e6bd7-a6f9-4720-af3d-93d59e4d9729)
Author
Owner

@advplyr commented on GitHub (Jul 14, 2024):

I don't believe the "Purge Items Cache" button could have anything to do with removing metadata changes.

That button is just removing the folder /metadata/cache/items

https://github.com/advplyr/audiobookshelf/blob/733f61075f2fd5dc2965d996979836eb1403b936/server/managers/CacheManager.js#L122-L130

@advplyr commented on GitHub (Jul 14, 2024): I don't believe the "Purge Items Cache" button could have anything to do with removing metadata changes. That button is just removing the folder `/metadata/cache/items` https://github.com/advplyr/audiobookshelf/blob/733f61075f2fd5dc2965d996979836eb1403b936/server/managers/CacheManager.js#L122-L130
Author
Owner

@xcy7e commented on GitHub (Jul 15, 2024):

Thats it!

I remember removing all metadata.json files in the item folders to remove old data, assuming the disabled setting "Store metadata in item folders" would have make the remaining metadata.json files in the item folders to be obsolet.

Can one clarify for my understanding?

@xcy7e commented on GitHub (Jul 15, 2024): Thats it! I remember removing all metadata.json files in the item folders to remove old data, assuming the **disabled** setting "Store metadata in item folders" would have make the remaining metadata.json files in the item folders to be obsolet. Can one clarify for my understanding?
Author
Owner

@nichwall commented on GitHub (Jul 15, 2024):

I remember removing all metadata.json files in the item folders to remove old data, assuming the disabled setting "Store metadata in item folders" would have make the remaining metadata.json files in the item folders to be obsolet.

Can one clarify for my understanding?

The metadata files are only created/updated whenever there is a change to the book in ABS (either from manually editing it, matching against an online provider, scanning, or the watcher picking data up). The metadata files are not moved when this setting is changed, so if you had done metadata work with Store metadata in item folders enabled, the metadata files only exist there. If you then disabled the setting but did not edit any books, then the metadata.json files still only exist in the items folder and do not exist in /metadata/items. Any books you edited in ABS after disabling the setting would have their metadata stored in /metadata/items.

Not sure exactly on what order you did things, but that should hopefully explain it.

A feature to move all of the metadata files is planned.

@nichwall commented on GitHub (Jul 15, 2024): > I remember removing all metadata.json files in the item folders to remove old data, assuming the **disabled** setting "Store metadata in item folders" would have make the remaining metadata.json files in the item folders to be obsolet. > > Can one clarify for my understanding? The metadata files are only created/updated whenever there is a change to the book in ABS (either from manually editing it, matching against an online provider, scanning, or the watcher picking data up). The metadata files are not moved when this setting is changed, so if you had done metadata work with `Store metadata in item folders` enabled, the metadata files only exist there. If you then disabled the setting but did not edit any books, then the `metadata.json` files still only exist in the items folder and do not exist in `/metadata/items`. Any books you edited in ABS *after* disabling the setting would have their metadata stored in `/metadata/items`. Not sure exactly on what order you did things, but that should hopefully explain it. A feature to move all of the metadata files is planned.
Author
Owner

@xcy7e commented on GitHub (Jul 15, 2024):

You perfectly understood and described my issue and explained it, so now I understand this.

So far, thank you guys!
Me, back in the realm

@xcy7e commented on GitHub (Jul 15, 2024): You perfectly understood and described my issue and explained it, so now I understand this. So far, thank you guys! Me, back in the realm
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2103