Update podcast.numEpisodes when episodes are created or destroyed

This commit is contained in:
mikiher 2025-02-16 12:38:44 +02:00
parent 8f192b1b17
commit 0169bf5518
3 changed files with 16 additions and 1 deletions

View file

@ -232,6 +232,11 @@ class PodcastManager {
await libraryItem.save()
if (libraryItem.media.numEpisodes !== libraryItem.media.podcastEpisodes.length) {
libraryItem.media.numEpisodes = libraryItem.media.podcastEpisodes.length
await libraryItem.media.save()
}
SocketAuthority.emitter('item_updated', libraryItem.toOldJSONExpanded())
const podcastEpisodeExpanded = podcastEpisode.toOldJSONExpanded(libraryItem.id)
podcastEpisodeExpanded.libraryItem = libraryItem.toOldJSONExpanded()