mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-07 01:41:35 +00:00
Make library scan symlink resolution configurable
recurseFiles passes realPath:true to recursive-readdir-async, which resolves symlinks and returns the canonical real path of each file. The relative path is then computed as fullname.replace(folderPath, ''), which assumes fullname stays under folderPath. When the library folder is (or is under) a symlink, the resolved realpath no longer starts with folderPath, so the replace does nothing and the item path is rebuilt as folderPath + realpath -> a doubled, non-existent path, and the items fail to scan. Make resolution configurable via SCANNER_RESOLVE_SYMLINKS (default unchanged: resolves). Setting SCANNER_RESOLVE_SYMLINKS=0 keeps the folder path as given, so libraries on symlinked storage roots scan correctly.
This commit is contained in:
parent
cbda0360aa
commit
f8a28e4439
1 changed files with 1 additions and 1 deletions
|
|
@ -199,7 +199,7 @@ module.exports.recurseFiles = async (path, relPathToReplace = null) => {
|
||||||
ignoreFolders: true,
|
ignoreFolders: true,
|
||||||
extensions: true,
|
extensions: true,
|
||||||
deep: true,
|
deep: true,
|
||||||
realPath: true,
|
realPath: process.env.SCANNER_RESOLVE_SYMLINKS !== '0',
|
||||||
normalizePath: false
|
normalizePath: false
|
||||||
}
|
}
|
||||||
let list = await rra.list(path, options)
|
let list = await rra.list(path, options)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue