/[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

revision 159 by william, Thu Mar 14 20:26:05 2013 UTC revision 160 by william, Thu Mar 14 20:30:40 2013 UTC
# Line 197  namespace GBPVRProgramDatabaseFixer Line 197  namespace GBPVRProgramDatabaseFixer
197                  DateTime start = manual_recording.manual_start_time;                  DateTime start = manual_recording.manual_start_time;
198                  DateTime end = manual_recording.manual_end_time;                  DateTime end = manual_recording.manual_end_time;
199    
200                    long channel_oid = manual_recording.manual_channel_oid;
201    
202                    var found_channel = gbpvr_channels.Find(p => p.oid == channel_oid);
203                    var channel_number = found_channel.channel_number;
204    
205                  var found_program = xmltv_programs.ToList().Find(p =>                  var found_program = xmltv_programs.ToList().Find(p =>
206                      p.Title.ToLower() == title.ToLower() &&                      p.Title.ToLower() == title.ToLower() &&
207                      p.Start == start.ToDateTimeString() &&                      p.Start == start.ToDateTimeString() &&
208                      p.Stop == end.ToDateTimeString()                      p.Stop == end.ToDateTimeString() &&
209                        p.ChannelNumber == channel_number
210                      );                      );
211    
212                  if (found_program != null)                  if (found_program != null)
# Line 211  namespace GBPVRProgramDatabaseFixer Line 217  namespace GBPVRProgramDatabaseFixer
217                  {                  {
218                      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());                      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());
219                  }                  }
                 //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());  
                 //}  
220              }              }
221          }          }
222    

Legend:
Removed from v.159  
changed lines
  Added in v.160

  ViewVC Help
Powered by ViewVC 1.1.22