fix mp4 upload and video conversion progress display; fixes #21

This commit is contained in:
Lukas F. Hartmann
2018-05-07 20:19:07 +02:00
parent dc986dcc7e
commit c075c562d6
2 changed files with 26 additions and 29 deletions

View File

@@ -123,11 +123,11 @@ router.post('/:artifact_id/payload', function(req, res, next) {
var writeStream = fs.createWriteStream(localFilePath);
var stream = req.pipe(writeStream);
var progress_callback = function(progress_msg) {
a.description = progress_msg.toString();
var progressCallback = function(progressMsg) {
a.description = progressMsg.toString();
db.packArtifact(a);
a.save();
redis.sendMessage("update", a, JSON.stringify(a), req.channelId);
redis.sendMessage("update", "Artifact", a, req.channelId);
};
stream.on('finish', function() {
@@ -137,7 +137,7 @@ router.post('/:artifact_id/payload', function(req, res, next) {
db.Space.update({ updated_at: new Date() }, {where: {_id: req.space._id}});
res.distributeUpdate("Artifact", artifact);
}
}, progress_callback);
}, progressCallback);
});
} else {
res.status(401).json({