From fe43cf7d142fb62bd8bbcce96d005f153a6a3415 Mon Sep 17 00:00:00 2001 From: Pavion Date: Thu, 21 Jan 2016 07:34:57 +0100 Subject: [PATCH] Recurrent records fix (recurrence mask will be applied to the start date) --- .gitignore | 3 ++- tvstreamrecord.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index d435b0d..768887e 100644 --- a/.gitignore +++ b/.gitignore @@ -49,4 +49,5 @@ coverage.xml # Sphinx documentation docs/_build/channels.m3u /nbproject/ -!/cherrypy/lib/ \ No newline at end of file +!/cherrypy/lib/ +/live.m3u \ No newline at end of file diff --git a/tvstreamrecord.py b/tvstreamrecord.py index 9c670d2..da894a0 100644 --- a/tvstreamrecord.py +++ b/tvstreamrecord.py @@ -921,13 +921,13 @@ def __init__(self, row): else: self.ext = row[7] if self.mask > 0: - w = self.bis.isoweekday() if self.bis.isoweekday()<7 else 0 - if not (self.bis>=datetime.now() and getWeekdays(self.mask)[w]): + w = self.von.isoweekday() if self.von.isoweekday()<7 else 0 + if not (self.von>=datetime.now() and getWeekdays(self.mask)[w]): delta = timedelta(days=1) - while not (self.bis>=datetime.now() and getWeekdays(self.mask)[w]): + while not (self.von>=datetime.now() and getWeekdays(self.mask)[w]): self.von = self.von + delta self.bis = self.bis + delta - w = self.bis.isoweekday() if self.bis.isoweekday()<7 else 0 + w = self.von.isoweekday() if self.von.isoweekday()<7 else 0 print ("Recurrent record '%s' moved to %s" % (self.name, self.von)) sqlRun("UPDATE records SET rvon='%s', rbis='%s' WHERE rowid=%d" % (datetime.strftime(self.von,"%Y-%m-%d %H:%M:%S"), datetime.strftime(self.bis,"%Y-%m-%d %H:%M:%S"), self.id ) )