Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

IsOnAir reload issue #43 #45

Closed
wants to merge 7 commits into from
Closed

IsOnAir reload issue #43 #45

wants to merge 7 commits into from

Conversation

matsprea
Copy link
Contributor

In the last 3 minutes of the countdown it checks if the show is OnAir and if os it reloads the page.

@dnfclas
Copy link

dnfclas commented Aug 11, 2015

Hi @matsprea, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla2.dotnetfoundation.org.

TTYL, DNFBOT;

@dnfclas
Copy link

dnfclas commented Aug 11, 2015

@matsprea, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, DNFBOT;

@DamianEdwards
Copy link
Member

Thanks for this. I think this would work even better if it detected the following state changes and reloaded for each one:

  • off-air to standby
  • standby to on-air
  • standby to off-air
  • on-air to standby

I don't want it to auto-reload for the on-air to off-air state change as people might have paused it and it would be annoying if it flipped back automatically.

You'll probably need to update the new action you added to return a state (rather than boolean) and track the state change in the client, reloading when the changes above are detected.

var interval = window.setInterval(function () {
var now = new Date(),
diff = dateDiff(now, futureDate);

if (!isOnAirPolling && diff.totalSecs < 3 * 60) {
isOnAirPolling = window.setInterval(function() {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use spaces (4) instead of tabs.

@matsprea
Copy link
Contributor Author

I will update the PR to detect the state changes, but to do so the polling could not be limited to the last few minutes before the OnAir as it does in this PR.

@matsprea
Copy link
Contributor Author

Now, it should do what are you're suggeting, but only if there is a next show scheduled.
It sounds reasonable to me since if there isn't a show scheduled, an unknown amount of time could pass before a "noShow" -> "OffAir" or a "noShow" -> "Standby" transition and it will be useless to waste resources in polling.
BTW, let me know if you would like to have this check included all the time.

get
{
if (!string.IsNullOrEmpty(AdminMessage))
return ShowStatus.Standby;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add braces please.

@DamianEdwards
Copy link
Member

@matsprea
Copy link
Contributor Author

The polling is active only in the last N minutes of the countdown or when it's in standby.

@matsprea
Copy link
Contributor Author

matsprea commented Mar 1, 2017

@DamianEdwards should I try to update the PR for addressing the conflicts or there is no longer interest in this feature?

@hishamco
Copy link
Contributor

hishamco commented Mar 1, 2017

@martinpf If I'm not wrong, the current website update itself and show's the youtube popup when the status "OnAir"

@DamianEdwards
Copy link
Member

@matsprea I have no plan to add this right now, but thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants