mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-31 00:05:27 +02:00
Add: author object, author search api, author images #187
This commit is contained in:
parent
979fb70c31
commit
5308801540
15 changed files with 772 additions and 31 deletions
|
@ -141,4 +141,20 @@ async function recurseFiles(path) {
|
|||
// })
|
||||
return list
|
||||
}
|
||||
module.exports.recurseFiles = recurseFiles
|
||||
module.exports.recurseFiles = recurseFiles
|
||||
|
||||
module.exports.downloadFile = async (url, filepath) => {
|
||||
Logger.debug(`[fileUtils] Downloading file to ${filepath}`)
|
||||
|
||||
const writer = fs.createWriteStream(filepath)
|
||||
const response = await axios({
|
||||
url,
|
||||
method: 'GET',
|
||||
responseType: 'stream'
|
||||
})
|
||||
response.data.pipe(writer)
|
||||
return new Promise((resolve, reject) => {
|
||||
writer.on('finish', resolve)
|
||||
writer.on('error', reject)
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue