From 0f3efe8e07f9831f1081ff43a7350673e1a295e1 Mon Sep 17 00:00:00 2001 From: erik Date: Sat, 25 Mar 2006 17:43:42 +0000 Subject: [PATCH] Corrected sorting of programs. --- crawler/kiss/conf/kiss/programs.xml | 30 ++++++++++++++----- .../org/wamblee/crawler/kiss/guide/Time.java | 18 ++++++++++- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/crawler/kiss/conf/kiss/programs.xml b/crawler/kiss/conf/kiss/programs.xml index 57f14cf6..0417895f 100644 --- a/crawler/kiss/conf/kiss/programs.xml +++ b/crawler/kiss/conf/kiss/programs.xml @@ -1,9 +1,9 @@ - erik@brakkee.org + kiss@brakkee.org erik@brakkee.org - KiSS Crawler Update + Recording summary for today falcon 25 @@ -27,19 +27,25 @@ horror|actie|thriller + + wetenschap + notify + wetenschap + + science fiction notify - (sci-fi)|(science fiction) + sf-|(sci-fi)|(science fiction) documentaires - notify (zembla)|(uur.*wolf)|(andere tijden) + 20 star.*gate @@ -58,6 +64,17 @@ + 9 + lois.*clark + + + + 8 + jag + + + + 5 shouf shouf @@ -70,12 +87,9 @@ + wetenschap notify brainiac - - lois.*clark - - diff --git a/crawler/kiss/src/org/wamblee/crawler/kiss/guide/Time.java b/crawler/kiss/src/org/wamblee/crawler/kiss/guide/Time.java index 52695e10..2a15073b 100644 --- a/crawler/kiss/src/org/wamblee/crawler/kiss/guide/Time.java +++ b/crawler/kiss/src/org/wamblee/crawler/kiss/guide/Time.java @@ -24,6 +24,16 @@ import java.text.NumberFormat; */ public class Time implements Comparable { + /** + * + */ + private static final int HOURS_PER_DAY = 24; + + /** + * + */ + private static final int EARLY_HOUR = 3; + /** * Number of seconds per minute. */ @@ -87,7 +97,13 @@ public class Time implements Comparable { * @return Converted value. */ float asFloat() { - return (float) _hour + (float) _minute / (float) SECONDS_PER_MINUTE; + int hour = _hour; + // Hack to make sure that programs appearing shortly after midnight are sorted + // after those running during the day. + if ( hour <= EARLY_HOUR ) { + hour += HOURS_PER_DAY; + } + return (float) hour + (float) _minute / (float) SECONDS_PER_MINUTE; } /* -- 2.31.1