-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent media_duration warnings and null values from events API #712
Conversation
We don't use media_duration, we use video_duration! PHP message: PHP Notice: Undefined index: media_duration in /usr/share/bluecherry/www/ajax/events/eventsIndex.php on line 128 root@fvi-bcdvr1:/usr/share/bluecherry/www/ajax/events# grep "media_duration" /var/log/nginx/bluecherry-error.log |wc -l 243107
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge, but there are more mysteries :)
This change should definitely stop the flood of warnings in web server error log.
But it's unclear what is the reader of this field.
I still can't find out.
There's nothing in the codebase (this, or old client, or Unity client codebases) taking a value of a "media_duration" field of anything.
There's www/template/ajax/playback/listEvents.php:27
which reads $val['duration']
, but it works fine for the output of events selection, querying which also doesn't produce these warnings. Which is another problem: I don't know how to reproduce the warnings on an otherwise completely idle system.
I'm not sure if this is related, but currently the video duration returned by the server is incorrect and does not match the actual video duration. |
@bdlukaa probably is related, thanks for replying! What does it return? |
The video duration is defined by the following rule:
This is how the event are fetched: Maybe it is an issue with the way the client fetches things or is the rule above wrong? Should I make use of |
Thanks a lot for coming here and sharing this! So indeed the client app is what causes the code in eventIndex.php to run. The data returned has the following shape, so you can use It's interesting that
|
For uniformity. Doesn't change the behaviour.
@andrey-utkin In our test server (7007cams), the media duration for all events return |
This is fixed on master branch, but not released yet, i can give you a custom build to test.
|
We don't use media_duration, we use video_duration!
PHP message: PHP Notice: Undefined index: media_duration in /usr/share/bluecherry/www/ajax/events/eventsIndex.php on line 128
root@fvi-bcdvr1:/usr/share/bluecherry/www/ajax/events# grep "media_duration" /var/log/nginx/bluecherry-error.log |wc -l 243107