rootio / rootio_web

RootIO web app & telephony services
https://rootio.eu
GNU Affero General Public License v3.0
36 stars 19 forks source link

Correct the reporting on the summary schedule program, showing current and past programs #385

Closed judelove closed 4 years ago

judelove commented 4 years ago

At the moment the page does not correctly report the current program. This should be changed to consider the current program as the last started program that has not yet ended.

carlosmouracorreia commented 4 years ago

I've been told by the guys this was a timestamp issue as the program summary gets shown with the current timestamp in UTC mode. I've changed it for the station current timestamp. Is your scenario another addition to this issue? Thanks @judelove

carlosmouracorreia commented 4 years ago

On the query that scrutinises start < now and end > now which could return multiple results, instead of returning the first one, I've ordered the results this way: scheduled_program.end ASC , and then return the first. this way, it actually returns the current playing program (the one that ends the soonest, though it's not completely accurate if the program has failed).

Shall we add a filter for status different then 0 (error) or 2 (no_media) ? @judelove