Genre tag is not used #55

Closed
opened 2026-04-24 22:57:19 +02:00 by adam · 13 comments
Owner

Originally created by @TheSylus on GitHub (Oct 18, 2021).

Hi, my audiobooks have genres filled by mp3tag (Genre 1, Genre 2 and GENRE), but audiobookshelf does not use these tags.
Is this a bug or did I something wrong.
I am on 1.4.11 using Unraid.

Besides that, great tool.

Originally created by @TheSylus on GitHub (Oct 18, 2021). Hi, my audiobooks have genres filled by mp3tag (Genre 1, Genre 2 and GENRE), but audiobookshelf does not use these tags. Is this a bug or did I something wrong. I am on 1.4.11 using Unraid. Besides that, great tool.
adam closed this issue 2026-04-24 22:57:19 +02:00
Author
Owner

@advplyr commented on GitHub (Oct 18, 2021):

I started setting that up but I didn't have any audiobooks that set those metatags, so I didn't test it.

If you could test it that would be great, and I will add it in the next release.

In the code here you can see the prober is checking if it found some other tags I was considering using, like genre, series, releasetime, etc., and it prints a log if it find one.

In order to test:

  1. Change the logger to "Debug". In config click the logger button and choose debug in the dropdown.
  2. Remove one of the books you know have the genre tags set by clicking the remove button in the edit modal.
  3. Open the container log from unraid docker page and scan the library.

Hopefully you see this in the log:

[DEBUG] Notable! file_tag_genre1
[DEBUG] Notable! file_tag_genre2

heads up though, debug is going to dump out a bunch of logs.

@advplyr commented on GitHub (Oct 18, 2021): I started setting that up but I didn't have any audiobooks that set those metatags, so I didn't test it. If you could test it that would be great, and I will add it in the next release. In the code [here](https://github.com/advplyr/audiobookshelf/blob/master/server/utils/prober.js#L177) you can see the prober is checking if it found some other tags I was considering using, like genre, series, releasetime, etc., and it prints a log if it find one. In order to test: 1. Change the logger to "Debug". In config click the logger button and choose debug in the dropdown. 2. Remove one of the books you know have the genre tags set by clicking the remove button in the edit modal. 3. Open the container log from unraid docker page and scan the library. Hopefully you see this in the log: ``` [DEBUG] Notable! file_tag_genre1 [DEBUG] Notable! file_tag_genre2 ``` heads up though, debug is going to dump out a bunch of logs.
Author
Owner

@TheSylus commented on GitHub (Oct 19, 2021):

Hm, I dont see the log you posted.
The only Notable! is
Notable! file_tag_series, which refers to the series and is working fine.
Further, I see
[Book] Mapping metadata to key tagPublisher
[Book] Mapping metadata to key tagSubtitle
but nothing related to genres.

@TheSylus commented on GitHub (Oct 19, 2021): Hm, I dont see the log you posted. The only Notable! is Notable! file_tag_series, which refers to the series and is working fine. Further, I see [Book] Mapping metadata to key tagPublisher [Book] Mapping metadata to key tagSubtitle but nothing related to genres.
Author
Owner

@advplyr commented on GitHub (Oct 21, 2021):

I added a dump of the raw audio file tags to make this easier to test in v1.4.13.
If you go to the track manager page and have experimental features turned on, you will see the "Check Track Numbers" button at the bottom.

We are looking for the key that is used for genre on you audio files.

image

@advplyr commented on GitHub (Oct 21, 2021): I added a dump of the raw audio file tags to make this easier to test in v1.4.13. If you go to the track manager page and have experimental features turned on, you will see the "Check Track Numbers" button at the bottom. We are looking for the key that is used for genre on you audio files. ![image](https://user-images.githubusercontent.com/67830747/138188281-a9effe8d-8c00-444d-a6fb-583c7cffedbf.png)
Author
Owner

@TheSylus commented on GitHub (Oct 21, 2021):

Okay, here we go.

"genre":"Science Fiction & Fantasy/Fantasy",
"TMP_GENRE1":"Science Fiction & Fantasy",
"TMP_GENRE2":"Fantasy"

These are the 3 genres I fetched from audible.
In my case, Genre2 would be the best. It seems that genre is just adding genre1 and genre2 which would lead to a alot of genres .

@TheSylus commented on GitHub (Oct 21, 2021): Okay, here we go. "genre":"Science Fiction & Fantasy/Fantasy", "TMP_GENRE1":"Science Fiction & Fantasy", "TMP_GENRE2":"Fantasy" These are the 3 genres I fetched from audible. In my case, Genre2 would be the best. It seems that genre is just adding genre1 and genre2 which would lead to a alot of genres .
Author
Owner

@advplyr commented on GitHub (Oct 21, 2021):

Interesting... have you tested other audiobooks?
Just taking in TMP_GENRE2 doesn't seem right, but also parsing "Science Fiction & Fantasy/Fantasy" wouldn't make sense either.

@advplyr commented on GitHub (Oct 21, 2021): Interesting... have you tested other audiobooks? Just taking in TMP_GENRE2 doesn't seem right, but also parsing "Science Fiction & Fantasy/Fantasy" wouldn't make sense either.
Author
Owner

@TheSylus commented on GitHub (Oct 21, 2021):

So, I tested several audiobooks and I think both (Genre1 and Genre2) are correct. Most of the time it is up to the personal preferences.

So what to do?
I would suggest, we can use both genres. When I filter for fantasy books, the book would appear and in the case I filter for Science Fiction the books would come up aswell.
So we dont have a 1 to 1 relation, but a 1 to 2 relaltion and we dont lose any information.
In the case that someone uses just one Genre, it is also fine.

@TheSylus commented on GitHub (Oct 21, 2021): So, I tested several audiobooks and I think both (Genre1 and Genre2) are correct. Most of the time it is up to the personal preferences. So what to do? I would suggest, we can use both genres. When I filter for fantasy books, the book would appear and in the case I filter for Science Fiction the books would come up aswell. So we dont have a 1 to 1 relation, but a 1 to 2 relaltion and we dont lose any information. In the case that someone uses just one Genre, it is also fine.
Author
Owner

@advplyr commented on GitHub (Oct 21, 2021):

How would you handle "TMP_GENRE1" in the example you posted?
It would use "Science Fiction & Fantasy" as a single genre. Is that just mislabeled?

@advplyr commented on GitHub (Oct 21, 2021): How would you handle "TMP_GENRE1" in the example you posted? It would use "Science Fiction & Fantasy" as a single genre. Is that just mislabeled?
Author
Owner

@TheSylus commented on GitHub (Oct 22, 2021):

I think that Science Fiction & Fantasy is just bad labeled.

However, I had a look at the mp3tag forum. TMP_GENRE1 and TMP_GENRE2 are mainly placeholder tags, which are used while scrapping from audible.com

Genre is a multi-value field, which is also used to have several genres. The separator is / , //, or ;

So my idea would be to use only "genre" and extract both genres and use them.

@TheSylus commented on GitHub (Oct 22, 2021): I think that Science Fiction & Fantasy is just bad labeled. However, I had a look at the mp3tag forum. TMP_GENRE1 and TMP_GENRE2 are mainly placeholder tags, which are used while scrapping from audible.com Genre is a multi-value field, which is also used to have several genres. The separator is / , //, or ; So my idea would be to use only "genre" and extract both genres and use them.
Author
Owner

@advplyr commented on GitHub (Oct 23, 2021):

In v1.4.14 I included mapping the genre meta tag.

I haven't actually tested this yet, but it should split the genre tag by the separators you showed.

Once I confirm this is all good I will put out a release and update the docs. The update is available now though if you get a chance to test it out.

@advplyr commented on GitHub (Oct 23, 2021): In `v1.4.14` I included mapping the genre meta tag. I haven't actually tested this yet, but it should split the genre tag by the separators you showed. Once I confirm this is all good I will put out a release and update the docs. The update is available now though if you get a chance to test it out.
Author
Owner

@TheSylus commented on GitHub (Oct 23, 2021):

The logger shows:
Notable! file_tag_genre
However, for the same book the Genres is still empty when I click on edit book
and when I filter for genres, still no genres are listed.

@TheSylus commented on GitHub (Oct 23, 2021): The logger shows: Notable! file_tag_genre However, for the same book the Genres is still empty when I click on edit book and when I filter for genres, still no genres are listed.
Author
Owner

@advplyr commented on GitHub (Oct 23, 2021):

I just pushed a patch and actually tested this time and it is working. If you open the edit modal to an audiobook and press re-scan it will re-map metatags now.
Just make sure that there are no genres on the audiobook you are re-scanning (dont forget to save after removing genres).

Let me know how that goes.

@advplyr commented on GitHub (Oct 23, 2021): I just pushed a patch and actually tested this time and it is working. If you open the edit modal to an audiobook and press re-scan it will re-map metatags now. Just make sure that there are no genres on the audiobook you are re-scanning (dont forget to save after removing genres). Let me know how that goes.
Author
Owner

@TheSylus commented on GitHub (Oct 23, 2021):

It works perfectly fine. No issues at all.
Thx a lot

@TheSylus commented on GitHub (Oct 23, 2021): It works perfectly fine. No issues at all. Thx a lot
Author
Owner

@advplyr commented on GitHub (Oct 24, 2021):

Included in release v1.5.0!

@advplyr commented on GitHub (Oct 24, 2021): Included in release [v1.5.0](https://github.com/advplyr/audiobookshelf/releases/tag/v1.5.0)!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#55