mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-18 10:59:41 +02:00
Fix:Check if Windows before cleaning file path for POSIX separators #1254
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user