some handling for videos that have no monitor associated in db

video-slicer-reencoder
Moe 2022-09-29 20:57:01 -07:00
parent 02b0873688
commit 066d5a4d58
2 changed files with 7 additions and 3 deletions

View File

@ -7,7 +7,7 @@ $(document).ready(function(){
var newTabId = getVideoPlayerTabId(video)
var humanStartTime = formattedTime(video.time,true)
var humanEndTime = formattedTime(video.end,true)
var tabLabel = `<b>${lang['Video']}</b> : ${loadedMonitors[video.mid].name} : ${formattedTime(video.time,true)}`
var tabLabel = `<b>${lang['Video']}</b> : ${loadedMonitors[video.mid] ? loadedMonitors[video.mid].name : lang['Monitor or Key does not exist.']} : ${formattedTime(video.time,true)}`
var videoUrl = getLocation() + video.href
var hasRows = video.events && video.events.length > 0
var loadedEvents = {}

View File

@ -340,13 +340,17 @@ function getAllDays(videos,frames){
})
videos.forEach(function(video){
var videoTime = new Date(video.time)
var monitorId = video.mid
var theDayKey = `${videoTime.getDate()}-${videoTime.getMonth()}-${videoTime.getFullYear()}`
listOfDays[video.mid][theDayKey] = []
if(!listOfDays[monitorId])listOfDays[monitorId] = {};
listOfDays[monitorId][theDayKey] = []
})
frames.forEach(function(frame){
var frameTime = new Date(frame.time)
var monitorId = frame.mid
var theDayKey = `${frameTime.getDate()}-${frameTime.getMonth()}-${frameTime.getFullYear()}`
listOfDays[frame.mid][theDayKey] = []
if(!listOfDays[monitorId])listOfDays[monitorId] = {};
listOfDays[monitorId][theDayKey] = []
})
return listOfDays
}