mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-16 04:14:58 +02:00
Fix:Check if Windows before cleaning file path for POSIX separators #1254
This commit is contained in:
parent
f76f9c7f84
commit
9a85ad1f6b
19 changed files with 66 additions and 54 deletions
|
@ -5,6 +5,7 @@ const njodb = require('../libs/njodb')
|
|||
const { SupportedEbookTypes } = require('./globals')
|
||||
const { PlayMethod } = require('./constants')
|
||||
const { getId } = require('./index')
|
||||
const { filePathToPOSIX } = require('./fileUtils')
|
||||
const Logger = require('../Logger')
|
||||
|
||||
const Library = require('../objects/Library')
|
||||
|
@ -87,8 +88,8 @@ function makeSeriesFromOldAb({ series, volumeNumber }) {
|
|||
}
|
||||
|
||||
function getRelativePath(srcPath, basePath) {
|
||||
srcPath = srcPath.replace(/\\/g, '/')
|
||||
basePath = basePath.replace(/\\/g, '/')
|
||||
srcPath = filePathToPOSIX(srcPath)
|
||||
basePath = filePathToPOSIX(basePath)
|
||||
return srcPath.replace(basePath, '')
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue