mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-15 08:19:37 +00:00
Fix:Downloader sets file permission and owner on files #286
This commit is contained in:
parent
405d333d60
commit
590dbe3991
2 changed files with 8 additions and 3 deletions
|
|
@ -5,16 +5,18 @@ const archiver = require('archiver')
|
|||
const workerThreads = require('worker_threads')
|
||||
const Logger = require('./Logger')
|
||||
const Download = require('./objects/Download')
|
||||
const filePerms = require('./utils/filePerms')
|
||||
const { getId } = require('./utils/index')
|
||||
const { writeConcatFile, writeMetadataFile } = require('./utils/ffmpegHelpers')
|
||||
const { getFileSize } = require('./utils/fileUtils')
|
||||
const TAG = 'DownloadManager'
|
||||
class DownloadManager {
|
||||
constructor(db, MetadataPath, AudiobookPath, emitter) {
|
||||
constructor(db, MetadataPath, AudiobookPath, Uid, Gid) {
|
||||
this.Uid = Uid
|
||||
this.Gid = Gid
|
||||
this.db = db
|
||||
this.MetadataPath = MetadataPath
|
||||
this.AudiobookPath = AudiobookPath
|
||||
this.emitter = emitter
|
||||
|
||||
this.downloadDirPath = Path.join(this.MetadataPath, 'downloads')
|
||||
|
||||
|
|
@ -343,6 +345,9 @@ class DownloadManager {
|
|||
return
|
||||
}
|
||||
|
||||
// Set file permissions and ownership
|
||||
await filePerms(download.fullPath, 0o774, this.Uid, this.Gid)
|
||||
|
||||
var filesize = await getFileSize(download.fullPath)
|
||||
download.setComplete(filesize)
|
||||
if (download.socket) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue