mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-02 21:44:56 +02:00
Fix:Podcast episodes duplicated when a scan runs while the episode is downloading #2785
This commit is contained in:
parent
a5ebd89817
commit
850ed48955
5 changed files with 40 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
|||
const Path = require('path')
|
||||
const uuidv4 = require("uuid").v4
|
||||
const { sanitizeFilename } = require('../utils/fileUtils')
|
||||
const uuidv4 = require('uuid').v4
|
||||
const { sanitizeFilename, filePathToPOSIX } = require('../utils/fileUtils')
|
||||
const globals = require('../utils/globals')
|
||||
|
||||
class PodcastEpisodeDownload {
|
||||
|
@ -60,7 +60,7 @@ class PodcastEpisodeDownload {
|
|||
return sanitizeFilename(filename)
|
||||
}
|
||||
get targetPath() {
|
||||
return Path.join(this.libraryItem.path, this.targetFilename)
|
||||
return filePathToPOSIX(Path.join(this.libraryItem.path, this.targetFilename))
|
||||
}
|
||||
get targetRelPath() {
|
||||
return this.targetFilename
|
||||
|
@ -74,7 +74,8 @@ class PodcastEpisodeDownload {
|
|||
this.podcastEpisode = podcastEpisode
|
||||
|
||||
const url = podcastEpisode.enclosure.url
|
||||
if (decodeURIComponent(url) !== url) { // Already encoded
|
||||
if (decodeURIComponent(url) !== url) {
|
||||
// Already encoded
|
||||
this.url = url
|
||||
} else {
|
||||
this.url = encodeURI(url)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue