[PR #5145] Playlist podcast add cleanup #4443

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/5145
Author: @nichwall
Created: 3/23/2026
Status: 🔄 Open

Base: masterHead: playlist-podcast-add-cleanup


📝 Commits (2)

  • 2bc6dcf Prevent loading full podcast when adding episodes to playlist
  • 2b8f008 Inline minimal podcast episode findAll

📊 Changes

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

View changed files

📝 server/controllers/PlaylistController.js (+12 -54)
server/utils/playlistHelpers.js (+100 -0)

📄 Description

Brief summary

When adding podcast episodes to a playlist, only load the relevant episodes instead of loading the entire podcast with all episodes.

Which issue is fixed?

Fixes https://github.com/advplyr/audiobookshelf/issues/5129

In-depth Description

A helper function was created to allow reuse of the same logic between single additions and batch mode.

This function filters the request by libraryItemId, episodeIds, and bookIds (by checking if there is an associated episode). Then, we request each set of data from the database without loading all podcast episodes. This data is then formatted into the same JSON with expanded information the playlist object expects.

This does not take user access controls for books and podcasts into account, but this was not taken into account prior to changing the database queries.

How have you tested this?

Adding podcast episodes and books to existing and new playlists. I verified adding to a playlist from a large podcast (over 2000 episodes) would run out of memory prior to these changes, and episodes are successfully added after applying the changes.

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/5145 **Author:** [@nichwall](https://github.com/nichwall) **Created:** 3/23/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `playlist-podcast-add-cleanup` --- ### 📝 Commits (2) - [`2bc6dcf`](https://github.com/advplyr/audiobookshelf/commit/2bc6dcf5767829f91de2b5f83091fbfc1ed41db7) Prevent loading full podcast when adding episodes to playlist - [`2b8f008`](https://github.com/advplyr/audiobookshelf/commit/2b8f0082df26d146770132aa3d1b19ea56ec56bb) Inline minimal podcast episode findAll ### 📊 Changes **2 files changed** (+112 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `server/controllers/PlaylistController.js` (+12 -54) ➕ `server/utils/playlistHelpers.js` (+100 -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 When adding podcast episodes to a playlist, only load the relevant episodes instead of loading the entire podcast with all episodes. ## Which issue is fixed? Fixes https://github.com/advplyr/audiobookshelf/issues/5129 ## In-depth Description A helper function was created to allow reuse of the same logic between single additions and batch mode. This function filters the request by `libraryItemId`, `episodeIds`, and `bookIds` (by checking if there is an associated episode). Then, we request each set of data from the database without loading all podcast episodes. This data is then formatted into the same JSON with expanded information the playlist object expects. This does *not* take user access controls for books and podcasts into account, but this was not taken into account prior to changing the database queries. ## How have you tested this? Adding podcast episodes and books to existing and new playlists. I verified adding to a playlist from a large podcast (over 2000 episodes) would run out of memory prior to these changes, and episodes are successfully added after applying the changes. ## 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:19:46 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4443