Skip to content

Commit

Permalink
[RecordTimer] Fine tuned Auto (Deep) Standby setting.
Browse files Browse the repository at this point in the history
Signed-off vy Birdman

This fixes/changes what happens when a Record Timer ends and it has an Auto (Deep) Standby setting (or Auto, and was woken for the recording):

1-    If a playback is active (and the box is not in Standby - which it can be when a playback is noted as being active...) then don't prompt about going to Standby/DeepStandby - ignore the timer. [If you are watching a playback you clearly do not want to go to any Standby state.]
2-    If there is an active streaming client (e.g. via OpenWebIF) then also ignore the Standby/DeepStandby possibility. [If you are streaming you may well not be in front of the box to cancel the request so without this check you'll be chopped]
  • Loading branch information
RobvanderDoes committed Aug 4, 2016
1 parent 7fee5fa commit 9e303cf
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions RecordTimer.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,19 @@ def activate(self):
self.record_service = None

NavigationInstance.instance.RecordTimer.saveTimer()

# From here on we are checking whether to put the box into Standby or
# Deep Standby.
# Don't even *bother* checking this if a playback is in progress
# (unless we are in Standby - in which case it isn't really in playback)
# ....just say the timer has been handled.
# Trying to back off isn't worth it as backing off in Record timers
# currently only refers to *starting* a recording.
#
from Screens.InfoBar import MoviePlayer
if (not Screens.Standby.inStandby) and (MoviePlayer.instance is not None):
return True

if self.afterEvent == AFTEREVENT.STANDBY or (not wasRecTimerWakeup and self.autostate and self.afterEvent == AFTEREVENT.AUTO) or self.wasInStandby:
self.keypress() #this unbinds the keypress detection
if not Screens.Standby.inStandby: # not already in standby
Expand All @@ -503,6 +516,17 @@ def activate(self):
if (abs(NavigationInstance.instance.RecordTimer.getNextRecordingTime() - time()) <= 900 or abs(NavigationInstance.instance.RecordTimer.getNextZapTime() - time()) <= 900) or NavigationInstance.instance.RecordTimer.getStillRecording():
print '[RecordTimer] Recording or Recording due is next 15 mins, not return to deepstandby'
return True

# Also check for someone streaming remotely - in which case we don't
# want DEEPSTANDBY.
# Might consider going to standby instead, but probably not worth it...
# Also might want to back off - but that is set-up for trying to start
# recordings, so has a low maximum delay.
#
from Components.Converter.ClientsStreaming import ClientsStreaming;
if int(ClientsStreaming("NUMBER").getText()) > 0:
return True
#
if not Screens.Standby.inTryQuitMainloop: # not a shutdown messagebox is open
if Screens.Standby.inStandby: # in standby
quitMainloop(1)
Expand Down

0 comments on commit 9e303cf

Please sign in to comment.