mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-31 15:19:42 +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
|
@ -1,5 +1,4 @@
|
|||
const Path = require('path')
|
||||
const fs = require('fs')
|
||||
const Logger = require('../Logger')
|
||||
const { parseString } = require("xml2js")
|
||||
const areEquivalent = require('./areEquivalent')
|
||||
|
@ -125,10 +124,6 @@ module.exports.copyValue = (val) => {
|
|||
}
|
||||
}
|
||||
|
||||
module.exports.encodeUriPath = (path) => {
|
||||
return path.replace(/\\/g, '/').replace(/%/g, '%25').replace(/#/g, '%23')
|
||||
}
|
||||
|
||||
module.exports.toNumber = (val, fallback = 0) => {
|
||||
if (isNaN(val) || val === null) return fallback
|
||||
return Number(val)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue