Merge pull request #4373 from Vito0912/feat/maybeFixPodcast

Potential fix/new knowledge for hangig podcasts
This commit is contained in:
advplyr 2025-06-04 16:33:40 -05:00 committed by GitHub
commit f01055f6e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -384,7 +384,17 @@ class PodcastManager {
Logger.error(`[PodcastManager] checkPodcastForNewEpisodes no feed url for ${podcastLibraryItem.media.title} (ID: ${podcastLibraryItem.id})`)
return null
}
const feed = await getPodcastFeed(podcastLibraryItem.media.feedURL)
const feed = await Promise.race([
getPodcastFeed(podcastLibraryItem.media.feedURL),
new Promise((_, reject) =>
// The added second is to make sure that axios can fail first and only falls back later
setTimeout(() => reject(new Error('Timeout. getPodcastFeed seemed to timeout but not triggering the timeout.')), global.PodcastDownloadTimeout + 1000)
)
]).catch((error) => {
Logger.error(`[PodcastManager] checkPodcastForNewEpisodes failed to fetch feed for ${podcastLibraryItem.media.title} (ID: ${podcastLibraryItem.id}):`, error)
return null
})
if (!feed?.episodes) {
Logger.error(`[PodcastManager] checkPodcastForNewEpisodes invalid feed payload for ${podcastLibraryItem.media.title} (ID: ${podcastLibraryItem.id})`, feed)
return null