[PR #4649] [MERGED] [fix] prevent duplicates in multi-selects #4311

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4649
Author: @votex001
Created: 9/3/2025
Status: Merged
Merged: 12/21/2025
Merged by: @advplyr

Base: masterHead: multi-select-item-fix


📝 Commits (1)

  • fbe9971 [fix] prevent duplicates in multi-selects

📊 Changes

2 files changed (+2 additions, -2 deletions)

View changed files

📝 client/components/ui/MultiSelect.vue (+1 -1)
📝 client/components/ui/MultiSelectQueryInput.vue (+1 -1)

📄 Description

Brief summary

Ensure that items are not duplicated in multi-select components.

In-depth Description

Previously, selecting items multiple times could add duplicates to the selected list.
This PR updates the logic for multi-select in multiple components:

  • if (!this.selected.find((i) => i.name === item.name)) this.selected.push(item)
  • if (!this.selected.includes(item)) this.selected.push(item)

Now, both components only add items that are not already selected, ensuring uniqueness in the selected list.

How have you tested this?

  1. Open book details.
  2. Input the same item multiple times.
  3. Verify that the item appears only once in the selected list.
  4. Test with different items to ensure all are selectable without duplication.

##Before

https://github.com/user-attachments/assets/2e175f76-22ec-4bae-9959-e8858b6e3a75

##After

https://github.com/user-attachments/assets/e189b794-2f2b-47aa-8070-4e088fb845a4


🔄 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/4649 **Author:** [@votex001](https://github.com/votex001) **Created:** 9/3/2025 **Status:** ✅ Merged **Merged:** 12/21/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `multi-select-item-fix` --- ### 📝 Commits (1) - [`fbe9971`](https://github.com/advplyr/audiobookshelf/commit/fbe9971a8b4fa3606ef8dbd8262a40ba03d40f3c) [fix] prevent duplicates in multi-selects ### 📊 Changes **2 files changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `client/components/ui/MultiSelect.vue` (+1 -1) 📝 `client/components/ui/MultiSelectQueryInput.vue` (+1 -1) </details> ### 📄 Description ## Brief summary Ensure that items are not duplicated in multi-select components. ## In-depth Description Previously, selecting items multiple times could add duplicates to the `selected` list. This PR updates the logic for multi-select in multiple components: - `if (!this.selected.find((i) => i.name === item.name)) this.selected.push(item)` - `if (!this.selected.includes(item)) this.selected.push(item)` Now, both components only add items that are not already selected, ensuring uniqueness in the `selected` list. ## How have you tested this? 1. Open book details. 2. Input the same item multiple times. 3. Verify that the item appears only once in the `selected` list. 4. Test with different items to ensure all are selectable without duplication. ##Before https://github.com/user-attachments/assets/2e175f76-22ec-4bae-9959-e8858b6e3a75 ##After https://github.com/user-attachments/assets/e189b794-2f2b-47aa-8070-4e088fb845a4 --- <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:14 +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#4311