[Bug]: Deleted Genres & Tags re-appear after re-scan of the library #2376

Open
opened 2026-04-25 00:06:37 +02:00 by adam · 4 comments
Owner

Originally created by @b3nd1k on GitHub (Nov 25, 2024).

What happened?

Through the WebUI, I navigated to Settings -> Item Metadata Utils. Under the section Manage Tags and Manage Genres I deleted a large amount of unnecessary tags, as well as merging tags and genres that have similar names. For example, Fiction Books, Fiction, Fictional was merged into Fiction.

What did you expect to happen?

I expected the changes and removal of genres and tags I made to remain after a re-scan of the library. I have the "Store metadata with item" option checked under Settings, but I assume what happens is that the changes I made are not written to the metadata file, so that when the re-scan appears it adds the information back.

Steps to reproduce the issue

To reproduce the issue, go to Settings -> Item Metadata Utils and either remove or rename any tags. After re-scanning the library, you will notice that the removed or renamed tags reappear.

Audiobookshelf version

v.2.17.2

How are you running audiobookshelf?

Docker

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?

Firefox

Logs

No response

Additional Notes

No response

Originally created by @b3nd1k on GitHub (Nov 25, 2024). ### What happened? Through the WebUI, I navigated to Settings -> Item Metadata Utils. Under the section _Manage Tags_ and _Manage Genres_ I deleted a large amount of unnecessary tags, as well as merging tags and genres that have similar names. For example, Fiction Books, Fiction, Fictional was merged into Fiction. ### What did you expect to happen? I expected the changes and removal of genres and tags I made to remain after a re-scan of the library. I have the "Store metadata with item" option checked under Settings, but I assume what happens is that the changes I made are not written to the metadata file, so that when the re-scan appears it adds the information back. ### Steps to reproduce the issue To reproduce the issue, go to Settings -> Item Metadata Utils and either remove or rename any tags. After re-scanning the library, you will notice that the removed or renamed tags reappear. ### Audiobookshelf version v.2.17.2 ### How are you running audiobookshelf? Docker ### 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? Firefox ### Logs _No response_ ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:06:37 +02:00
Author
Owner

@advplyr commented on GitHub (Dec 1, 2024):

I'm not able to reproduce this issue. I can see that the tag gets removed from the metadata.json file.

Maybe the tags are getting pulled from another file during the scan. Do you have an OPF file or an NFO file with that book?

@advplyr commented on GitHub (Dec 1, 2024): I'm not able to reproduce this issue. I can see that the tag gets removed from the `metadata.json` file. Maybe the tags are getting pulled from another file during the scan. Do you have an OPF file or an NFO file with that book?
Author
Owner

@b3nd1k commented on GitHub (Dec 2, 2024):

Do you have an OPF file or an NFO file with that book?

You're probably on to something. The path of the my eBook library in ABS is pointed to my Calibre eBook library. Under Scanner, I have given the Audiobookshelf metadata file a higher priority than OPF file. The thought was that ABS would pick up the metadata from the Calibre library on the initial scan, but then ignore changes to the OPF-file on additional scans.

Am I correct to assume that when I delete a tag from Item Metadata Utils, the Audiobook metadata field for tags goes blank and re-import the tags from the OPF file, rather than locking that field to be blank? Since I have Audiobook metadata field_ set higher than the OPF file, the expected behaviour would be that ABS prevents the tags from getting re-added.

Screenshot 2024-12-02 at 08 19 31
@b3nd1k commented on GitHub (Dec 2, 2024): > Do you have an OPF file or an NFO file with that book? You're probably on to something. The path of the my eBook library in ABS is pointed to my Calibre eBook library. Under _Scanner_, I have given the _Audiobookshelf metadata file_ a higher priority than _OPF file_. The thought was that ABS would pick up the metadata from the Calibre library on the initial scan, but then ignore changes to the OPF-file on additional scans. Am I correct to assume that when I delete a tag from _Item Metadata Utils_, the _Audiobook metadata field_ for tags goes blank and re-import the tags from the _OPF file_, rather than locking that field to be blank? Since I have Audiobook metadata field_ set higher than the OPF file, the expected behaviour would be that ABS prevents the tags from getting re-added. <img width="799" alt="Screenshot 2024-12-02 at 08 19 31" src="https://github.com/user-attachments/assets/e0885af5-289d-42cd-9042-98fe0787c3ce">
Author
Owner

@advplyr commented on GitHub (Dec 2, 2024):

This is a decision we have to figure out how to best implement. For the case of genres, tags and chapters if they are empty in the metadata file they are ignored, meaning it will not overwrite with an empty array.

I think you're right in assuming it should though. For the case of narrators and series the metadata file will take precedence and keep them empty. There was just a PR opened to make narrators and series behave like genres, tags and chapters. https://github.com/advplyr/audiobookshelf/pull/3671

@advplyr commented on GitHub (Dec 2, 2024): This is a decision we have to figure out how to best implement. For the case of genres, tags and chapters if they are empty in the metadata file they are ignored, meaning it will not overwrite with an empty array. I think you're right in assuming it should though. For the case of narrators and series the metadata file *will* take precedence and keep them empty. There was just a PR opened to make narrators and series behave like genres, tags and chapters. https://github.com/advplyr/audiobookshelf/pull/3671
Author
Owner

@b3nd1k commented on GitHub (Dec 3, 2024):

From what I can tell, there seems to be different opinions on how to best handle this issue. The way I see it is that this is by the order of precedence. If Audiobookshelf metadata file is higher than the OPF file it will remain black, if not, it will re-import.

@b3nd1k commented on GitHub (Dec 3, 2024): From what I can tell, there seems to be different opinions on how to best handle this issue. The way I see it is that this is by the order of precedence. If _Audiobookshelf metadata file_ is higher than the _OPF file_ it will remain black, if not, it will re-import.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2376