mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Use ensureDir instead of mkdir to fix 698
This commit updates the mkdir for creating the download location to ensureDir, which is an alias for mkdirs and mkdirp, meaning they will create the entire path of the directory if it does not exist. https://github.com/jprichardson/node-fs-extra/blob/master/docs/ensureDir.md
This commit is contained in:
parent
ac00f3ebe7
commit
35f29ca22b
@ -73,9 +73,10 @@ class AbMergeManager {
|
||||
|
||||
|
||||
try {
|
||||
await fs.mkdir(download.dirpath)
|
||||
await fs.ensureDir(download.dirpath)
|
||||
} catch (error) {
|
||||
Logger.error(`[AbMergeManager] Failed to make directory ${download.dirpath}`)
|
||||
Logger.debug(`[AbMergeManager] Make directory error: ${error}`)
|
||||
var downloadJson = download.toJSON()
|
||||
this.clientEmitter(user.id, 'abmerge_failed', downloadJson)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user