mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-24 12:54:31 +02:00
New data model save covers, scanner, new api routes
This commit is contained in:
parent
5f4e5cd3d8
commit
73257188f6
37 changed files with 1649 additions and 672 deletions
|
@ -77,7 +77,19 @@ const chmodr = (p, mode, uid, gid, cb) => {
|
|||
})
|
||||
}
|
||||
|
||||
module.exports = (path, mode, uid, gid, silent = false) => {
|
||||
// Set custom permissions
|
||||
module.exports.set = (path, mode, uid, gid, silent = false) => {
|
||||
return new Promise((resolve) => {
|
||||
if (!silent) Logger.debug(`[FilePerms] Setting permission "${mode}" for uid ${uid} and gid ${gid} | "${path}"`)
|
||||
chmodr(path, mode, uid, gid, resolve)
|
||||
})
|
||||
}
|
||||
|
||||
// Default permissions 0o744 and global Uid/Gid
|
||||
module.exports.setDefault = (path, silent = false) => {
|
||||
const mode = 0o744
|
||||
const uid = global.Uid
|
||||
const gid = global.Gid
|
||||
return new Promise((resolve) => {
|
||||
if (!silent) Logger.debug(`[FilePerms] Setting permission "${mode}" for uid ${uid} and gid ${gid} | "${path}"`)
|
||||
chmodr(path, mode, uid, gid, resolve)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue