Add "onMonitorDied" extender
parent
d35a058412
commit
bf7a5d2d83
|
@ -34,7 +34,7 @@ module.exports = function(s){
|
|||
if(config.databaseLogs === undefined){config.databaseLogs=false}
|
||||
if(config.useUTC === undefined){config.useUTC=false}
|
||||
if(config.iconURL === undefined){config.iconURL = "https://shinobi.video/libs/assets/icon/apple-touch-icon-152x152.png"}
|
||||
if(config.pipeAddition === undefined){config.pipeAddition=7}else{config.pipeAddition=parseInt(config.pipeAddition)}
|
||||
if(config.pipeAddition === undefined){config.pipeAddition=10}else{config.pipeAddition=parseInt(config.pipeAddition)}
|
||||
if(config.hideCloudSaveUrls === undefined){config.hideCloudSaveUrls = true}
|
||||
if(config.insertOrphans === undefined){config.insertOrphans = true}
|
||||
if(config.orphanedVideoCheckMax === undefined){config.orphanedVideoCheckMax = 20}
|
||||
|
|
|
@ -91,6 +91,11 @@ module.exports = function(s,config){
|
|||
s.onMonitorPingFailed = function(callback){
|
||||
s.onMonitorPingFailedExtensions.push(callback)
|
||||
}
|
||||
//
|
||||
s.onMonitorDiedExtensions = []
|
||||
s.onMonitorDied = function(callback){
|
||||
s.onMonitorDiedExtensions.push(callback)
|
||||
}
|
||||
|
||||
///////// SYSTEM ////////
|
||||
s.onProcessReadyExtensions = []
|
||||
|
|
|
@ -1352,7 +1352,10 @@ module.exports = function(s,config,lang){
|
|||
}else{
|
||||
s.cameraDestroy(s.group[e.ke].mon[e.id].spawn,e)
|
||||
}
|
||||
s.sendMonitorStatus({id:e.id,ke:e.ke,status:lang.Died});
|
||||
s.sendMonitorStatus({id:e.id,ke:e.ke,status:lang.Died})
|
||||
s.onMonitorDiedExtensions.forEach(function(extender){
|
||||
extender(Object.assign(s.group[e.ke].mon_conf[e.id],{}),e)
|
||||
})
|
||||
}
|
||||
s.isWatchCountable = function(d){
|
||||
try{
|
||||
|
|
|
@ -958,7 +958,9 @@ module.exports = function(s,config,lang,app,io){
|
|||
res.setHeader('Content-Disposition', 'attachment; filename="'+filename+'"')
|
||||
var file = fs.createReadStream(fullPath)
|
||||
file.on('close',function(){
|
||||
s.file('delete',fullPath)
|
||||
setTimeout(function(){
|
||||
s.file('delete',fullPath)
|
||||
},1000 * 60 * 3)
|
||||
res.end()
|
||||
})
|
||||
file.pipe(res)
|
||||
|
|
Loading…
Reference in New Issue