mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-19 17:20:01 +02:00
Merge pull request #4598 from advplyr/episode_meta_tagging
Update podcast episode downloads to always attempt embedding meta tags
This commit is contained in:
commit
a89a24e48e
2 changed files with 10 additions and 31 deletions
|
@ -121,28 +121,17 @@ class PodcastManager {
|
||||||
await fs.mkdir(this.currentDownload.libraryItem.path)
|
await fs.mkdir(this.currentDownload.libraryItem.path)
|
||||||
}
|
}
|
||||||
|
|
||||||
let success = false
|
// Download episode and tag it
|
||||||
if (this.currentDownload.isMp3) {
|
const ffmpegDownloadResponse = await ffmpegHelpers.downloadPodcastEpisode(this.currentDownload).catch((error) => {
|
||||||
// Download episode and tag it
|
Logger.error(`[PodcastManager] Podcast Episode download failed`, error)
|
||||||
const ffmpegDownloadResponse = await ffmpegHelpers.downloadPodcastEpisode(this.currentDownload).catch((error) => {
|
})
|
||||||
Logger.error(`[PodcastManager] Podcast Episode download failed`, error)
|
let success = !!ffmpegDownloadResponse?.success
|
||||||
})
|
|
||||||
success = !!ffmpegDownloadResponse?.success
|
|
||||||
|
|
||||||
// If failed due to ffmpeg error, retry without tagging
|
// If failed due to ffmpeg error, retry without tagging
|
||||||
// e.g. RSS feed may have incorrect file extension and file type
|
// e.g. RSS feed may have incorrect file extension and file type
|
||||||
// See https://github.com/advplyr/audiobookshelf/issues/3837
|
// See https://github.com/advplyr/audiobookshelf/issues/3837
|
||||||
if (!success && ffmpegDownloadResponse?.isFfmpegError) {
|
if (!success && ffmpegDownloadResponse?.isFfmpegError) {
|
||||||
Logger.info(`[PodcastManager] Retrying episode download without tagging`)
|
Logger.info(`[PodcastManager] Retrying episode download without tagging`)
|
||||||
// Download episode only
|
|
||||||
success = await downloadFile(this.currentDownload.url, this.currentDownload.targetPath)
|
|
||||||
.then(() => true)
|
|
||||||
.catch((error) => {
|
|
||||||
Logger.error(`[PodcastManager] Podcast Episode download failed`, error)
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Download episode only
|
// Download episode only
|
||||||
success = await downloadFile(this.currentDownload.url, this.currentDownload.targetPath)
|
success = await downloadFile(this.currentDownload.url, this.currentDownload.targetPath)
|
||||||
.then(() => true)
|
.then(() => true)
|
||||||
|
|
|
@ -63,16 +63,6 @@ class PodcastEpisodeDownload {
|
||||||
const enclosureType = this.rssPodcastEpisode.enclosure.type
|
const enclosureType = this.rssPodcastEpisode.enclosure.type
|
||||||
return typeof enclosureType === 'string' ? enclosureType : null
|
return typeof enclosureType === 'string' ? enclosureType : null
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* RSS feed may have an episode with file extension of mp3 but the specified enclosure type is not mpeg.
|
|
||||||
* @see https://github.com/advplyr/audiobookshelf/issues/3711
|
|
||||||
*
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
get isMp3() {
|
|
||||||
if (this.enclosureType && !this.enclosureType.includes('mpeg')) return false
|
|
||||||
return this.fileExtension === 'mp3'
|
|
||||||
}
|
|
||||||
get episodeTitle() {
|
get episodeTitle() {
|
||||||
return this.rssPodcastEpisode.title
|
return this.rssPodcastEpisode.title
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue