mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-18 19:08:13 +02: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:
@@ -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
|
||||
|
Reference in New Issue
Block a user