Partial refactoring of v1.3/:dongleId/upload_url/, less code, started putting things into their own models.
Won't work until I finishpull/4/head
parent
446ab43887
commit
436aa3fda5
|
@ -0,0 +1,12 @@
|
|||
|
||||
|
||||
|
||||
|
||||
async function validateJWT(JWT, Key) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
validateJWT
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
module.exports = {
|
||||
authenticationController: require('./authentication')
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
|
||||
|
||||
function getUploadURL(driveType) {}
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
function getDrives(dongleId) {
|
||||
|
||||
}
|
||||
|
||||
async function getDevice(dongleId) {
|
||||
return await db.get('SELECT * FROM devices WHERE dongle_id = ?', dongleId);
|
||||
}
|
||||
|
||||
async function deviceCheckIn(dongleId) {
|
||||
await db.run(
|
||||
'UPDATE devices SET last_ping = ? WHERE dongle_id = ?',
|
||||
Date.now(), dongle_id
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getDevice,
|
||||
deviceCheckIn
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
|
||||
module.exports = {
|
||||
drivesModel: require('./drives')
|
||||
}
|
|
@ -130,7 +130,7 @@ function simpleStringify (object){
|
|||
simpleObject[prop] = object[prop];
|
||||
}
|
||||
return JSON.stringify(simpleObject); // returns cleaned up JSON
|
||||
};
|
||||
}
|
||||
|
||||
function writeFileSync(path, buffer, permission) {
|
||||
var fileDescriptor;
|
||||
|
@ -175,7 +175,7 @@ function moveUploadedFile(buffer, directory, filename) {
|
|||
}
|
||||
logger.error("moveUploadedFile invalid final path, check permissions to create / write '"+(config.storagePath+directory)+"'");
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function deleteFolderRecursive(directoryPath) {
|
||||
|
@ -190,7 +190,7 @@ function deleteFolderRecursive(directoryPath) {
|
|||
});
|
||||
fs.rmdirSync(directoryPath);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var segmentProcessQueue=[];
|
||||
var segmentProcessPosition=0;
|
||||
|
|
Loading…
Reference in New Issue