From ca7388b14e5f0615376a6fffa4d24cc9d9dd791b Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 2 Apr 2025 17:35:57 -0500 Subject: [PATCH] Fix download podcast update library item size #4180 --- server/managers/PodcastManager.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/managers/PodcastManager.js b/server/managers/PodcastManager.js index 086238d6..9c621ea1 100644 --- a/server/managers/PodcastManager.js +++ b/server/managers/PodcastManager.js @@ -211,6 +211,14 @@ class PodcastManager { const podcastEpisode = await Database.podcastEpisodeModel.createFromRssPodcastEpisode(this.currentDownload.rssPodcastEpisode, libraryItem.media.id, audioFile) libraryItem.libraryFiles.push(libraryFile.toJSON()) + // Re-calculating library item size because this wasnt being updated properly for podcasts in v2.20.0 and below + let libraryItemSize = 0 + libraryItem.libraryFiles.forEach((lf) => { + if (lf.metadata.size && !isNaN(lf.metadata.size)) { + libraryItemSize += Number(lf.metadata.size) + } + }) + libraryItem.size = libraryItemSize libraryItem.changed('libraryFiles', true) libraryItem.media.podcastEpisodes.push(podcastEpisode)