[PR #3614] [CLOSED] fix memory spike and high cpu usage when getting playlists with podcasts #4037

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3614
Author: @drwggm
Created: 11/15/2024
Status: Closed

Base: masterHead: master


📝 Commits (2)

  • 875e6ca updated getAllOldLibraryItems to grab subset of eps
  • f71b9b7 Update Playlist.js to get only episodes in playlist

📊 Changes

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

View changed files

📝 server/models/LibraryItem.js (+14 -6)
📝 server/models/Playlist.js (+4 -2)

📄 Description

This might be related to https://github.com/advplyr/audiobookshelf/pull/3015

  • I have a large number of podcasts, and some podcasts with a large number of episodes.
  • The current way podcasts are queried in playlists is very slow.
  • As far as I can tell, after looking up the libraryItemIds it grabs all episodes for any podcastIdin the playlist.
  • It only then filters the podcasts episodes contained in the playlist causing
  • Having so many podcasts episodes loaded everytime something is done with a playlist creates big memory spikes and cpu usage.

I do not know if this works for audiobooks, because I do not have a library to test it on, but it does seem to work for podcasts, so even if it breaks something hopefully it will give you some ideas on how to fix.

PS. I don't code JS, so apologies for messing up your codebase.


🔄 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/3614 **Author:** [@drwggm](https://github.com/drwggm) **Created:** 11/15/2024 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`875e6ca`](https://github.com/advplyr/audiobookshelf/commit/875e6cabe8836ef6f7a89e48f6d9438ed40859d2) updated getAllOldLibraryItems to grab subset of eps - [`f71b9b7`](https://github.com/advplyr/audiobookshelf/commit/f71b9b74073f555d81f3efa8410a4d6753ba417d) Update Playlist.js to get only episodes in playlist ### 📊 Changes **2 files changed** (+18 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `server/models/LibraryItem.js` (+14 -6) 📝 `server/models/Playlist.js` (+4 -2) </details> ### 📄 Description This might be related to https://github.com/advplyr/audiobookshelf/pull/3015 - I have a large number of podcasts, and some podcasts with a large number of episodes. - The current way podcasts are queried in playlists is very slow. - As far as I can tell, after looking up the `libraryItemIds` it grabs all episodes for any `podcastId`in the playlist. - It only then filters the podcasts episodes contained in the playlist causing - Having so many podcasts episodes loaded everytime something is done with a playlist creates big memory spikes and cpu usage. I do not know if this works for audiobooks, because I do not have a library to test it on, but it does seem to work for podcasts, so even if it breaks something hopefully it will give you some ideas on how to fix. PS. I don't code JS, so apologies for messing up your codebase. --- <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:04 +02:00
adam closed this issue 2026-04-25 00:18:04 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4037