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

Diff of /trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs

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

revision 169 by william, Sat Mar 16 14:04:31 2013 UTC revision 170 by william, Sat Mar 16 14:28:56 2013 UTC
# Line 304  namespace GBPVRProgramDatabaseFixer Line 304  namespace GBPVRProgramDatabaseFixer
304              //    return list;              //    return list;
305              //}              //}
306              //gLog.Warn.WriteLine("FilterProgramsByDateRange has not been implemented");              //gLog.Warn.WriteLine("FilterProgramsByDateRange has not been implemented");
307                
308              double total = gbpvr_programs.Count;              double total = gbpvr_programs.Count;
309              double index = 0;              double index = 0;
310              double progress = 0;              double progress = 0;
# Line 315  namespace GBPVRProgramDatabaseFixer Line 315  namespace GBPVRProgramDatabaseFixer
315                  var channel_oid = program.channel_oid;                  var channel_oid = program.channel_oid;
316                  var channel = this.Channels.Find(s => s.oid == channel_oid);                  var channel = this.Channels.Find(s => s.oid == channel_oid);
317                  var start_date = program.start_time;                  var start_date = program.start_time;
318                  var xmltv_entry = xmltv_programs.Find(s => s.ChannelNumber == channel.channel_number && s.Start == start_date.ToDateTimeString());                  var xmltv_entry_list = xmltv_programs.FindAll(s => s.ChannelNumber == channel.channel_number && s.Start == start_date.ToDateTimeString());
319                    IProgramDefinition xmltv_entry = null;
320                    if (xmltv_entry_list.Count > 0)
321                    {
322                        gLog.Error.WriteLine("Found more than one entry: Matching channel='{0}' and start='{1}'", channel.channel_number, start_date.ToDateTimeString());
323                        if (Debugger.IsAttached)
324                        {
325                            Debugger.Break();
326                        }
327                    }
328                    else
329                    {
330                        xmltv_entry = xmltv_entry_list.FirstOrDefault();
331                    }
332    
333                  if (xmltv_entry == null)                  if (xmltv_entry == null)
334                  {                  {
335                        gLog.Warn.WriteLine("Invalidating GB-PVR Program: oid='{0}' channel_oid='{1}' title='{2}' start='{3}'", program.oid, program.channel_oid, program.name, program.start_time.ToDateTimeString());
336                      source_invalid.Add(program);                      source_invalid.Add(program);
337                  }                  }
338                  else                  else
# Line 328  namespace GBPVRProgramDatabaseFixer Line 343  namespace GBPVRProgramDatabaseFixer
343                      updated_program.name = xmltv_entry.Title;                      updated_program.name = xmltv_entry.Title;
344                      updated_program.start_time = DateTime.Parse(xmltv_entry.Start);                                          updated_program.start_time = DateTime.Parse(xmltv_entry.Start);                    
345                      updated_program.sub_title = xmltv_entry.SubTitle;                      updated_program.sub_title = xmltv_entry.SubTitle;
346                        gLog.Warn.WriteLine("Updating GB-PVR Program: oid='{0}' channel_oid='{1}' title='{2}' subtitle='{3}' start='{4}'", program.oid, program.channel_oid, program.name,program.sub_title, program.start_time.ToDateTimeString());
347                        gLog.Warn.WriteLine("    Updated with Program: title='{0}' subtitle='{1}' start='{2}'", updated_program.name,updated_program.sub_title, program.start_time.ToDateTimeString());
348                      source_valid.Add(updated_program);                      source_valid.Add(updated_program);
349                  }                  }
350                  index++;                  index++;

Legend:
Removed from v.169  
changed lines
  Added in v.170

  ViewVC Help
Powered by ViewVC 1.1.22