git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix calculation of size, when dealing with big file ranges
[enigma2.git]
/
timer.py
diff --git
a/timer.py
b/timer.py
index 48ba7696c834d8866b369ed2770a5456edc408f7..a98481c0a3f957bcf0cff965f2a8de1e785feb2c 100644
(file)
--- a/
timer.py
+++ b/
timer.py
@@
-113,8
+113,13
@@
class Timer:
for f in self.on_state_change:
f(entry)
for f in self.on_state_change:
f(entry)
+ def getNextRecordingTime(self):
+ if len(self.timer_list) > 0:
+ return self.timer_list[0].begin
+ return -1
+
def cleanup(self):
def cleanup(self):
- self.processed_timers = []
+ self.processed_timers = [
entry for entry in self.processed_timers if entry.disabled
]
def addTimerEntry(self, entry, noRecalc=0):
entry.processRepeated()
def addTimerEntry(self, entry, noRecalc=0):
entry.processRepeated()
@@
-163,7
+168,10
@@
class Timer:
def timeChanged(self, timer):
timer.timeChanged()
def timeChanged(self, timer):
timer.timeChanged()
- self.timer_list.remove(timer)
+ if timer.state == TimerEntry.StateEnded:
+ self.processed_timers.remove(timer)
+ else:
+ self.timer_list.remove(timer)
self.addTimerEntry(timer)
self.addTimerEntry(timer)
@@
-173,8
+181,7
@@
class Timer:
# when activating a timer which has already passed,
# simply abort the timer. don't run trough all the stages.
if w.shouldSkip():
# when activating a timer which has already passed,
# simply abort the timer. don't run trough all the stages.
if w.shouldSkip():
- w.abort()
- bisect.insort(self.processed_timers, w)
+ w.state = TimerEntry.StateEnded
else:
# when active returns true, this means "accepted".
# otherwise, the current state is kept.
else:
# when active returns true, this means "accepted".
# otherwise, the current state is kept.