Corrected sorting of programs.
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 25 Mar 2006 17:43:42 +0000 (17:43 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 25 Mar 2006 17:43:42 +0000 (17:43 +0000)
crawler/kiss/conf/kiss/programs.xml
crawler/kiss/src/org/wamblee/crawler/kiss/guide/Time.java

index 57f14cf61fb56f7533de028ed3f94fa875aeaf10..0417895fb5c91b6757c1950cb88453e5751da239 100644 (file)
@@ -1,9 +1,9 @@
 <programs>
   
   <notification>
-    <from>erik@brakkee.org</from>
+    <from>kiss@brakkee.org</from>
     <to>erik@brakkee.org</to>
-    <subject>KiSS Crawler Update</subject>
+    <subject>Recording summary for today</subject>
     <smtp>
       <host>falcon</host>
       <port>25</port>
     <match field="description">horror|actie|thriller</match>
   </program>
   
+  <program>
+    <category>wetenschap</category>
+    <action>notify</action>
+    <match field="description">wetenschap</match>
+  </program>
+  
   <program>
     <category>science fiction</category>
     <action>notify</action>
-    <match field="description">(sci-fi)|(science fiction)</match>
+    <match field="description">sf-|(sci-fi)|(science fiction)</match>
   </program>
   
   <program>
     <category>documentaires</category>
-    <action>notify</action>
     <match>(zembla)|(uur.*wolf)|(andere tijden)</match>
   </program>
   
   <program>
+    <priority>20</priority>
     <match>star.*gate</match>
   </program>
 
   </program>
   
   <program>
+    <priority>9</priority>
+    <match>lois.*clark</match>
+  </program>
+  
+  <program>
+    <priority>8</priority>
+    <match>jag</match>
+  </program>
+  
+  <program>
+    <priority>5</priority>
     <match>shouf shouf</match>
   </program>
   
   </program>
   
   <program>
+    <category>wetenschap</category>
     <action>notify</action>
     <match>brainiac</match>
   </program>
   
-  <program>
-    <match>lois.*clark</match>
-  </program>
-  
 </programs>
index 52695e109ec1acca802da69e4543a7a343db5fdd..2a15073b7b8ae034b40fff83b9fff31969ea6f9f 100644 (file)
@@ -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;
     }
 
     /*