[PR #4041] [MERGED] Prevent duplicate episodes from being added to queue #4153

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4041
Author: @nichwall
Created: 2/25/2025
Status: Merged
Merged: 2/27/2025
Merged by: @advplyr

Base: masterHead: podcast_queue_no_duplicates


📝 Commits (2)

  • 6674189 Add: prevent duplicates from being added to queue
  • 0ca65d1 Show download icon for queued/downloaded episodes in rss feed modal

📊 Changes

4 files changed (+69 additions, -15 deletions)

View changed files

📝 client/components/modals/podcast/EpisodeFeed.vue (+57 -11)
📝 client/pages/item/_id/index.vue (+1 -3)
📝 server/managers/PodcastManager.js (+9 -0)
📝 server/objects/PodcastEpisodeDownload.js (+2 -1)

📄 Description

Brief summary

This PR checks if an episode download is already queue to prevent the same episodes being added multiple times.

Which issue is fixed?

Fixes https://github.com/advplyr/audiobookshelf/issues/2672 and https://github.com/advplyr/audiobookshelf/issues/4036.

In-depth Description

Before adding a podcast episode to the download queue, the server checks to make sure the URL and Library Item ID does not already exist in the download queue and is not already downloading. I am checking the Library Item ID in case the same podcast has been added to multiple libraries, such as having a dedicated podcast library for individual users who may have added the same podcast.

This does not fully solve the issue where:

  1. A user can open the "Find Episodes" modal and add a number of episodes to the download queue
  2. Reopen the "Find Episodes" modal before episodes finish downloading
  3. Wait for episodes to finish downloading
  4. Select the same episodes to download
  5. Download the same episodes

This is because the modal does not update the "download state" from the queue. I do not think the download queue should check for existing files because that can get complicated with other files already existing or not being matched, and is more of an edge case.

How have you tested this?

Tested using the web client to try and add each of the following cases:

  • All episodes already in the queue or currently downloading
  • Some episodes already in the queue or currently downloading
  • No episodes already in the queue or currently downloading

I have not created a dedicated test case for this.

Screenshots

N/A


🔄 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/4041 **Author:** [@nichwall](https://github.com/nichwall) **Created:** 2/25/2025 **Status:** ✅ Merged **Merged:** 2/27/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `podcast_queue_no_duplicates` --- ### 📝 Commits (2) - [`6674189`](https://github.com/advplyr/audiobookshelf/commit/6674189acd01b25ecb3a1392dee13f08e72c6f60) Add: prevent duplicates from being added to queue - [`0ca65d1`](https://github.com/advplyr/audiobookshelf/commit/0ca65d1f794db272122af66c6ceb3e285ce73732) Show download icon for queued/downloaded episodes in rss feed modal ### 📊 Changes **4 files changed** (+69 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `client/components/modals/podcast/EpisodeFeed.vue` (+57 -11) 📝 `client/pages/item/_id/index.vue` (+1 -3) 📝 `server/managers/PodcastManager.js` (+9 -0) 📝 `server/objects/PodcastEpisodeDownload.js` (+2 -1) </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 This PR checks if an episode download is already queue to prevent the same episodes being added multiple times. ## Which issue is fixed? Fixes https://github.com/advplyr/audiobookshelf/issues/2672 and https://github.com/advplyr/audiobookshelf/issues/4036. ## In-depth Description Before adding a podcast episode to the download queue, the server checks to make sure the URL and Library Item ID does not already exist in the download queue and is not already downloading. I am checking the Library Item ID in case the same podcast has been added to multiple libraries, such as having a dedicated podcast library for individual users who may have added the same podcast. This does not fully solve the issue where: 1. A user can open the "Find Episodes" modal and add a number of episodes to the download queue 2. Reopen the "Find Episodes" modal before episodes finish downloading 3. Wait for episodes to finish downloading 4. Select the same episodes to download 5. Download the same episodes This is because the modal does not update the "download state" from the queue. I do not think the download queue should check for existing files because that can get complicated with other files already existing or not being matched, and is more of an edge case. ## How have you tested this? Tested using the web client to try and add each of the following cases: - All episodes already in the queue or currently downloading - Some episodes already in the queue or currently downloading - No episodes already in the queue or currently downloading I have not created a dedicated test case for this. ## Screenshots N/A --- <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:18:34 +02:00
adam closed this issue 2026-04-25 00:18:34 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4153