Fix:Check if Windows before cleaning file path for POSIX separators #1254

This commit is contained in:
advplyr 2023-01-05 17:45:27 -06:00
parent f76f9c7f84
commit 9a85ad1f6b
19 changed files with 66 additions and 54 deletions

View file

@ -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) {