Fix:Podcast episodes duplicated when a scan runs while the episode is downloading #2785

This commit is contained in:
advplyr 2024-11-07 17:26:51 -06:00
parent a5ebd89817
commit 850ed48955
5 changed files with 40 additions and 6 deletions

View file

@ -97,6 +97,7 @@ class PodcastManager {
// Ignores all added files to this dir
Watcher.addIgnoreDir(this.currentDownload.libraryItem.path)
Watcher.ignoreFilePathsDownloading.add(this.currentDownload.targetPath)
// Make sure podcast library item folder exists
if (!(await fs.pathExists(this.currentDownload.libraryItem.path))) {
@ -151,6 +152,8 @@ class PodcastManager {
SocketAuthority.emitter('episode_download_queue_updated', this.getDownloadQueueDetails())
Watcher.removeIgnoreDir(this.currentDownload.libraryItem.path)
Watcher.ignoreFilePathsDownloading.delete(this.currentDownload.targetPath)
this.currentDownload = null
if (this.downloadQueue.length) {
this.startPodcastEpisodeDownload(this.downloadQueue.shift())