mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-02 21:24:22 -04:00
Fix download podcast update library item size #4180
This commit is contained in:
parent
ddf2ca3670
commit
ca7388b14e
@ -211,6 +211,14 @@ class PodcastManager {
|
|||||||
const podcastEpisode = await Database.podcastEpisodeModel.createFromRssPodcastEpisode(this.currentDownload.rssPodcastEpisode, libraryItem.media.id, audioFile)
|
const podcastEpisode = await Database.podcastEpisodeModel.createFromRssPodcastEpisode(this.currentDownload.rssPodcastEpisode, libraryItem.media.id, audioFile)
|
||||||
|
|
||||||
libraryItem.libraryFiles.push(libraryFile.toJSON())
|
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.changed('libraryFiles', true)
|
||||||
|
|
||||||
libraryItem.media.podcastEpisodes.push(podcastEpisode)
|
libraryItem.media.podcastEpisodes.push(podcastEpisode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user