mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-01 08:44:40 +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,6 +1,7 @@
|
|||
const Folder = require('./Folder')
|
||||
const LibrarySettings = require('./settings/LibrarySettings')
|
||||
const { getId } = require('../utils/index')
|
||||
const { filePathToPOSIX } = require('../utils/fileUtils')
|
||||
|
||||
class Library {
|
||||
constructor(library = null) {
|
||||
|
@ -156,8 +157,8 @@ class Library {
|
|||
}
|
||||
|
||||
checkFullPathInLibrary(fullPath) {
|
||||
fullPath = fullPath.replace(/\\/g, '/')
|
||||
return this.folders.find(folder => fullPath.startsWith(folder.fullPath.replace(/\\/g, '/')))
|
||||
fullPath = filePathToPOSIX(fullPath)
|
||||
return this.folders.find(folder => fullPath.startsWith(filePathToPOSIX(folder.fullPath)))
|
||||
}
|
||||
|
||||
getFolderById(id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue