[PR #4639] [CLOSED] Normalize tags and genres in BookFinder results #4309

Closed
opened 2026-04-25 00:19:13 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4639
Author: @Vito0912
Created: 8/31/2025
Status: Closed

Base: masterHead: feat/fixDuplicateTagsGenres


📝 Commits (1)

  • 4fbf306 Normalize tags and genres in BookFinder results

📊 Changes

1 file changed (+9 additions, -0 deletions)

View changed files

📝 server/finders/BookFinder.js (+9 -0)

📄 Description

Brief summary

Mentioned in https://github.com/advplyr/audiobookshelf/issues/4634#issuecomment-3239425190 Audible returns the same tag twice. This caused #4636. To avoid more issues, this PR adds validation to convert the strings/array into a Set first to make them unique.

On a side note, I am not sure why we return genres as an array and tags as a string (at least for the Audible Provider), and why both also work the other way around. This code normalizes it to always return an array. In my tests, this did not break anything, especially since ", " could interfere with actual tag comma separations.

Which issue is fixed?

Related to #4634

In-depth Description

See short description

How have you tested this?

Matching the mentioned book and a few other ones.

Screenshots


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4639 **Author:** [@Vito0912](https://github.com/Vito0912) **Created:** 8/31/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feat/fixDuplicateTagsGenres` --- ### 📝 Commits (1) - [`4fbf306`](https://github.com/advplyr/audiobookshelf/commit/4fbf306308b8b94c852fd3ac1de148160a86ff76) Normalize tags and genres in BookFinder results ### 📊 Changes **1 file changed** (+9 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/finders/BookFinder.js` (+9 -0) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary Mentioned in https://github.com/advplyr/audiobookshelf/issues/4634#issuecomment-3239425190 Audible returns the same tag twice. This caused #4636. To avoid more issues, this PR adds validation to convert the strings/array into a Set first to make them unique. On a side note, I am not sure why we return genres as an array and tags as a string (at least for the Audible Provider), and why both also work the other way around. This code normalizes it to always return an array. In my tests, this did not break anything, especially since ", " could interfere with actual tag comma separations. ## Which issue is fixed? Related to #4634 ## In-depth Description See short description ## How have you tested this? Matching the mentioned book and a few other ones. ## Screenshots <!-- If your PR includes any changes to the web client, please include screenshots or a short video from before and after your changes. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:19:13 +02:00
adam closed this issue 2026-04-25 00:19:14 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4309