From de5bc63d880d4236aaf09f8a0a9b7a876bcee111 Mon Sep 17 00:00:00 2001 From: mikiher Date: Sat, 11 Jan 2025 22:26:36 +0200 Subject: [PATCH] Remove deleted episode from returned libraryItem object --- server/controllers/PodcastController.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/controllers/PodcastController.js b/server/controllers/PodcastController.js index 1d1c106d..90b2c383 100644 --- a/server/controllers/PodcastController.js +++ b/server/controllers/PodcastController.js @@ -461,6 +461,9 @@ class PodcastController { return res.sendStatus(404) } + // Remove it from the podcastEpisodes array + req.libraryItem.media.podcastEpisodes = req.libraryItem.media.podcastEpisodes.filter((ep) => ep.id !== episodeId) + if (hardDelete) { const audioFile = episode.audioFile // TODO: this will trigger the watcher. should maybe handle this gracefully