]> git.0d.be Git - django-panik-emissions.git/commitdiff
nonstop: consider last program duration when adding nonstop slots
authorFrédéric Péters <fpeters@0d.be>
Thu, 28 Jun 2018 04:41:39 +0000 (06:41 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 28 Jun 2018 04:41:39 +0000 (06:41 +0200)
emissions/utils.py

index 2a39216fcf3656db12aaf94b345e74b2b8e556d4..b2ac34839b76719a8acc55e40b765561cbc9a438 100644 (file)
@@ -257,7 +257,10 @@ def period_program(date_start, date_end, prefetch_sounds=True,
         i += 1
 
     if program:
-        program.extend(NonstopSlot.get_serie(program[-1].datetime, last_day_end))
+        program.extend(
+                NonstopSlot.get_serie(program[-1].datetime +
+                    timedelta(minutes=program[-1].get_duration()),
+                last_day_end))
 
     return program