parent
cd38c01649
commit
3d7ae2081a
|
|
@ -1173,26 +1173,27 @@ module.exports = function(s,config,lang){
|
|||
var filename = d.split('.')[0]+'.'+e.ext
|
||||
s.insertCompletedVideo(e,{
|
||||
file : filename
|
||||
})
|
||||
s.log(e,{type:lang['Video Finished'],msg:{filename:d}})
|
||||
if(
|
||||
e.details.detector === '1' &&
|
||||
s.group[e.ke].mon[e.id].started === 1 &&
|
||||
e.details &&
|
||||
e.details.detector_record_method === 'del'&&
|
||||
e.details.detector_delete_motionless_videos === '1'&&
|
||||
s.group[e.ke].mon[e.id].detector_motion_count === 0
|
||||
){
|
||||
if(e.details.loglevel !== 'quiet'){
|
||||
s.log(e,{type:lang['Delete Motionless Video'],msg:filename});
|
||||
},function(err){
|
||||
s.log(e,{type:lang['Video Finished'],msg:{filename:d}})
|
||||
if(
|
||||
e.details.detector === '1' &&
|
||||
s.group[e.ke].mon[e.id].started === 1 &&
|
||||
e.details &&
|
||||
e.details.detector_record_method === 'del'&&
|
||||
e.details.detector_delete_motionless_videos === '1'&&
|
||||
s.group[e.ke].mon[e.id].detector_motion_count === 0
|
||||
){
|
||||
if(e.details.loglevel !== 'quiet'){
|
||||
s.log(e,{type:lang['Delete Motionless Video'],msg:filename})
|
||||
}
|
||||
s.deleteVideo({
|
||||
filename : filename,
|
||||
ke : e.ke,
|
||||
id : e.id
|
||||
})
|
||||
}
|
||||
s.deleteVideo({
|
||||
filename : filename,
|
||||
ke : e.ke,
|
||||
id : e.id
|
||||
})
|
||||
}
|
||||
s.group[e.ke].mon[e.id].detector_motion_count = 0
|
||||
s.group[e.ke].mon[e.id].detector_motion_count = 0
|
||||
})
|
||||
resetRecordingCheck()
|
||||
return;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ module.exports = function(s,config,lang){
|
|||
s.insertCompletedVideoExtensions.push(callback)
|
||||
}
|
||||
//on video completion
|
||||
s.insertCompletedVideo = function(e,k){
|
||||
s.insertCompletedVideo = function(e,k,callback){
|
||||
//e = video object
|
||||
//k = temporary values
|
||||
if(!e.id && e.mid)e.id = e.mid
|
||||
|
|
@ -154,7 +154,9 @@ module.exports = function(s,config,lang){
|
|||
k.filesize,
|
||||
k.endTime,
|
||||
]
|
||||
s.sqlQuery('INSERT INTO Videos (mid,ke,time,ext,status,details,size,end) VALUES (?,?,?,?,?,?,?,?)',save)
|
||||
s.sqlQuery('INSERT INTO Videos (mid,ke,time,ext,status,details,size,end) VALUES (?,?,?,?,?,?,?,?)',save,function(err){
|
||||
if(callback)callback(err)
|
||||
})
|
||||
//purge over max
|
||||
s.purgeDiskForGroup(e)
|
||||
//send new diskUsage values
|
||||
|
|
|
|||
Loading…
Reference in New Issue