mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-31 13:51:30 +02:00
Merge cae1560344
into 32da0f1224
This commit is contained in:
commit
f9ba057f66
@ -476,7 +476,7 @@ module.exports.getWindowsDrives = async () => {
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
exec('wmic logicaldisk get name', async (error, stdout, stderr) => {
|
exec('powershell -Command "(Get-PSDrive -PSProvider FileSystem).Name"', async (error, stdout, stderr) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(error)
|
reject(error)
|
||||||
return
|
return
|
||||||
@ -485,10 +485,9 @@ module.exports.getWindowsDrives = async () => {
|
|||||||
?.split(/\r?\n/)
|
?.split(/\r?\n/)
|
||||||
.map((line) => line.trim())
|
.map((line) => line.trim())
|
||||||
.filter((line) => line)
|
.filter((line) => line)
|
||||||
.slice(1)
|
|
||||||
const validDrives = []
|
const validDrives = []
|
||||||
for (const drive of drives) {
|
for (const drive of drives) {
|
||||||
let drivepath = drive + '/'
|
let drivepath = drive + ':/'
|
||||||
if (await fs.pathExists(drivepath)) {
|
if (await fs.pathExists(drivepath)) {
|
||||||
validDrives.push(drivepath)
|
validDrives.push(drivepath)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user