mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-08 23:04:51 +02:00
Fix:Check if Windows before cleaning file path for POSIX separators #1254
This commit is contained in:
@ -4,7 +4,7 @@ const SocketAuthority = require('../SocketAuthority')
|
||||
const fs = require('../libs/fsExtra')
|
||||
|
||||
const { getPodcastFeed, findMatchingEpisodes } = require('../utils/podcastUtils')
|
||||
const { getFileTimestampsWithIno } = require('../utils/fileUtils')
|
||||
const { getFileTimestampsWithIno, filePathToPOSIX } = require('../utils/fileUtils')
|
||||
const filePerms = require('../utils/filePerms')
|
||||
|
||||
const LibraryItem = require('../objects/LibraryItem')
|
||||
@ -30,7 +30,7 @@ class PodcastController {
|
||||
return res.status(404).send('Folder not found')
|
||||
}
|
||||
|
||||
var podcastPath = payload.path.replace(/\\/g, '/')
|
||||
const podcastPath = filePathToPOSIX(payload.path)
|
||||
if (await fs.pathExists(podcastPath)) {
|
||||
Logger.error(`[PodcastController] Podcast folder already exists "${podcastPath}"`)
|
||||
return res.status(400).send('Podcast already exists')
|
||||
|
Reference in New Issue
Block a user