Fix download podcast episode that is not mp3

This commit is contained in:
advplyr 2023-04-01 16:31:04 -05:00
parent fc36e86db7
commit 1a3f0e332e
3 changed files with 61 additions and 55 deletions

View file

@ -41,8 +41,12 @@ class PodcastEpisodeDownload {
}
}
get urlFileExtension() {
const cleanUrl = this.url.split('?')[0] // Remove query string
return Path.extname(cleanUrl).substring(1).toLowerCase()
}
get fileExtension() {
const extname = Path.extname(this.url).substring(1).toLowerCase()
const extname = this.urlFileExtension
if (globals.SupportedAudioTypes.includes(extname)) return extname
return 'mp3'
}