space: fix realtime artifact media conversion feedback for video, audio

This commit is contained in:
mntmn
2020-11-21 16:38:17 +01:00
parent 89f48e615f
commit 9a1e85fb94
8 changed files with 77 additions and 67 deletions

View File

@@ -17,9 +17,15 @@ module.exports = (req, res, next) => {
this.status(201).json(object);
};
res['distributeUpdate'] = function(model, object) {
res['distributeUpdate'] = function(model, object, sendToSelf) {
if (!object) return;
redis.sendMessage("update", model, object, req.channelId);
if (sendToSelf) {
// send this update to the initiating user, for example when
// a conversion task has finished
redis.sendMessage("update-self", model, object, req.channelId);
} else {
redis.sendMessage("update", model, object, req.channelId);
}
this.status(200).json(object);
};