Skip to content
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

OnNow playlist request should return most recent list for current time #79

Closed
eric-gilbertson opened this issue Oct 26, 2019 · 6 comments
Milestone

Comments

@eric-gilbertson
Copy link
Collaborator

eric-gilbertson commented Oct 26, 2019

OnNow playlist request should return most recent list for current time. Currently if there are two playlists active for the current time the onnow request will return the first one. Thus when a new PL is entered before the previous one has expired the older of the two will be returned and it will not match the 'on air' programming.

Reproduce:

  • enter a PL for 9:00 - 10:00 and enter tracks until 9:10
  • at 9:15 enter a new PL for 9:00 - 10:00 as a new DJ and enter tracks
  • execute onnow REST request - shows last track from 1st PL
@RocketMan
Copy link
Owner

In the example, it should be returning the 0900-1000 playlist, because the API picks the current list by sorting the playlists by showtime descending. As 0900-1000 sorts later than 0800-1000, that should be the one you get.

Can you give a specific set of playlists in prod where this did not happen? I would like to try to reproduce.

@eric-gilbertson
Copy link
Collaborator Author

This occurred on 10/24 between 9:00 and 10:00pm. I think the issue was that my reproduce steps were slightly incorrect, eg both shows were from 9:00 - 10:00. In this case Jim's show did not show until I edited Chano's show to end at 9:20 (originally it ended at 10:00). After this change Jim's show (which was on air) was returned by the onnow query.

@RocketMan
Copy link
Owner

After the second show ends at 0920, it is no longer on air. From then until 1000, the other show is returned by onNow, because it is still on air. After 1000, neither show is returned.

If someone came along at 0920 and entered a new show, say from 0920-1000, it would be returned by onNow instead of the 0900-1000 show, because it starts later and thus preempts the original one.

It's a little confusing because we allow entry of overlapping show times. The reason we do that is to prevent a bogusly entered show from locking out entry of another show later. In the case of overlapping shows, we cannot know which show is incorrect, so onNow picks the one with the last show start time.

@eric-gilbertson
Copy link
Collaborator Author

The issue here is that both shows had the same start time, eg 9:00. In this case the first show is returned. Instead the logic should be modified to return the newest show since it is most likely to be the current one.

@RocketMan
Copy link
Owner

By newest show, you mean last created?

RocketMan added a commit that referenced this issue Nov 4, 2019
@RocketMan
Copy link
Owner

Patch landed hotfix-2-4-0 and deployed to prod.

@RocketMan RocketMan added this to the v2.4.3 milestone Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants