From 12450a20d70b2e580223eca7f95132a1dff8fe31 Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 15 Jun 2017 00:48:40 +0100 Subject: deal with midnight --- menuApp/src/dirscanner.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'menuApp/src') diff --git a/menuApp/src/dirscanner.cpp b/menuApp/src/dirscanner.cpp index 942c352..5ba830b 100644 --- a/menuApp/src/dirscanner.cpp +++ b/menuApp/src/dirscanner.cpp @@ -71,7 +71,7 @@ void dirScanner::scan(){ int start = ofToInt(d.substr(0,4)); int end = ofToInt(d.substr(5,4)); - if (end){ + if (start||end){ slots.push_back(timeSlot(dir.getPath(i),start,end)); ofLogNotice() << "directory "<=railwaytime){ - return i; + if (slots[i].start=railwaytime){ + return i; + } } + else { + if (slots[i].end>=railwaytime||slots[i].start<=railwaytime){ + return i; + } + } + } return -1; } -- cgit v1.2.3