/[xmltv_parser]/trunk/GBPVRProgramDatabaseFixer/Program.cs
ViewVC logotype

Diff of /trunk/GBPVRProgramDatabaseFixer/Program.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/GBPVRProgramDatabaseFixer/Program.cs	2013/03/14 20:26:05	159
+++ trunk/GBPVRProgramDatabaseFixer/Program.cs	2013/03/14 20:30:40	160
@@ -197,10 +197,16 @@
                 DateTime start = manual_recording.manual_start_time;
                 DateTime end = manual_recording.manual_end_time;
 
+                long channel_oid = manual_recording.manual_channel_oid;
+
+                var found_channel = gbpvr_channels.Find(p => p.oid == channel_oid);
+                var channel_number = found_channel.channel_number;
+
                 var found_program = xmltv_programs.ToList().Find(p => 
                     p.Title.ToLower() == title.ToLower() && 
                     p.Start == start.ToDateTimeString() &&
-                    p.Stop == end.ToDateTimeString()
+                    p.Stop == end.ToDateTimeString() &&
+                    p.ChannelNumber == channel_number
                     );
 
                 if (found_program != null)
@@ -211,20 +217,6 @@
                 {
                     gLog.Warn.WriteLine("Recording may not be valid: oid='{0}' programme_oid='{1}' title='{2}' start='{3}', end='{4}'", manual_recording.oid, manual_recording.programme_oid, title, start.ToDateTimeString(), end.ToDateTimeString());
                 }
-                //bool entry_valid = false;
-                //if (found_programs.Count == 0)
-                //{
-                //    gLog.Warn.WriteLine("Could not find an XMLTV Program with title: '{0}'", title);
-                //}
-                //foreach (var found_program in found_programs)
-                //{                    
-                //    entry_valid = (found_program.Start == start.ToDateTimeString());
-                //    entry_valid = (found_program.Stop == end.ToDateTimeString());
-                //}
-                //if (!entry_valid)
-                //{
-                //    gLog.Warn.WriteLine("Recording: oid='{0}' programme_oid='{1}' title='{2}' start='{3}', end='{4}' may not be valid", manual_recording.oid, manual_recording.programme_oid, title, start.ToDateTimeString(), end.ToDateTimeString());
-                //}
             }
         }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22