Fix:Podcast episode downloads where RSS feed uses the same title #1802

This commit is contained in:
advplyr 2023-05-28 11:24:51 -05:00
parent 7a0f27e3cc
commit ea79948122
3 changed files with 14 additions and 2 deletions

View file

@ -15,6 +15,8 @@ class PodcastEpisodeDownload {
this.isFinished = false
this.failed = false
this.appendEpisodeId = false
this.startedAt = null
this.createdAt = null
this.finishedAt = null
@ -29,6 +31,7 @@ class PodcastEpisodeDownload {
libraryId: this.libraryId || null,
isFinished: this.isFinished,
failed: this.failed,
appendEpisodeId: this.appendEpisodeId,
startedAt: this.startedAt,
createdAt: this.createdAt,
finishedAt: this.finishedAt,
@ -52,7 +55,9 @@ class PodcastEpisodeDownload {
}
get targetFilename() {
return sanitizeFilename(`${this.podcastEpisode.title}.${this.fileExtension}`)
const appendage = this.appendEpisodeId ? ` (${this.podcastEpisode.id})` : ''
const filename = `${this.podcastEpisode.title}${appendage}.${this.fileExtension}`
return sanitizeFilename(filename)
}
get targetPath() {
return Path.join(this.libraryItem.path, this.targetFilename)