Skip to content

Commit

Permalink
www/ajax/events/eventsIndex.php: use media_duration in query
Browse files Browse the repository at this point in the history
For uniformity. Doesn't change the behaviour.
  • Loading branch information
andrey-utkin committed Nov 18, 2024
1 parent 5881ed8 commit f0061f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions www/ajax/events/eventsIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function getData()
$events_portion = 5000;

$query = "SELECT EventsCam.*, Media.size AS media_size, Media.start, Media.end, Devices.device_name, ((Media.size>0 OR Media.end=0) AND Media.filepath!='') AS media_available, ".
"IFNULL(TIMESTAMPDIFF(SECOND, Media.start, Media.end), 0) AS video_duration ".
"IFNULL(TIMESTAMPDIFF(SECOND, Media.start, Media.end), 0) AS media_duration ".
"FROM EventsCam ".
"LEFT JOIN Media ON (EventsCam.media_id=Media.id) ".
"LEFT JOIN Devices ON (EventsCam.device_id=Devices.id) ".
Expand Down Expand Up @@ -125,7 +125,7 @@ public function getData()
$entry['content'] = array(
'media_id' => $item['media_id'],
'media_size' => $item['media_size'],
'media_duration' => $item['video_duration'],
'media_duration' => $item['media_duration'],
'content' => (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/media/request.php?id=' . $item['media_id']
);
}
Expand Down

0 comments on commit f0061f3

Please sign in to comment.