From b2e571277916457e59db76ef99a859640fd0f798 Mon Sep 17 00:00:00 2001
From: Christian Pointner <equinox@helsinki.at>
Date: Sat, 30 Apr 2016 14:26:19 +0200
Subject: added check for start date in schedule generation


diff --git a/utils/rhrd-schedules b/utils/rhrd-schedules
index 2d509a9..aa67b10 100755
--- a/utils/rhrd-schedules
+++ b/utils/rhrd-schedules
@@ -49,7 +49,11 @@ sub generate
     my $title = ${$entry}{'title'};
     my $pvid = ${$entry}{'id'};
     my $showid = ${$entry}{'automation-id'};
+
     next if $pvid == 1; # 'Unmoderiertes Musikprogramm'
+    # maybe only the end is on this day - we don't need this to include in the log since only
+    # start times matter here.
+    next if ($start->year != $year || $start->month != $month || $start->day != $day);
 
     if($start->year != $year || $start->month != $month || $start->day != $day) {
       print "WARNING: skipping entry whith invalid start -> $start: $title ($pvid)\n";
@@ -103,6 +107,9 @@ sub show__day
     my $showid = ${$entry}{'automation-id'};
 
     next if $pvid == 1; # 'Unmoderiertes Musikprogramm'
+    # maybe only the end is on this day - we don't need this to include in the log since only
+    # start times matter here.
+    next if ($start->year != $year || $start->month != $month || $start->day != $day);
 
     print " " . DateTime::Format::Strptime::strftime("%H:%M:%S", $start) . ": ($showid) -> ";
     if($showid > 0) {
-- 
cgit v0.10.2