mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-19 00:18:56 +01:00
Fix:Download podcast episodes that are not mp3 #1513
This commit is contained in:
parent
ebad304aa9
commit
387a37e4da
@ -1,6 +1,7 @@
|
||||
const Path = require('path')
|
||||
const { getId } = require('../utils/index')
|
||||
const { sanitizeFilename } = require('../utils/fileUtils')
|
||||
const globals = require('../utils/globals')
|
||||
|
||||
class PodcastEpisodeDownload {
|
||||
constructor() {
|
||||
@ -40,8 +41,14 @@ class PodcastEpisodeDownload {
|
||||
}
|
||||
}
|
||||
|
||||
get fileExtension() {
|
||||
const extname = Path.extname(this.url).substring(1).toLowerCase()
|
||||
if (globals.SupportedAudioTypes.includes(extname)) return extname
|
||||
return 'mp3'
|
||||
}
|
||||
|
||||
get targetFilename() {
|
||||
return sanitizeFilename(`${this.podcastEpisode.title}.mp3`)
|
||||
return sanitizeFilename(`${this.podcastEpisode.title}.${this.fileExtension}`)
|
||||
}
|
||||
get targetPath() {
|
||||
return Path.join(this.libraryItem.path, this.targetFilename)
|
||||
|
Loading…
Reference in New Issue
Block a user