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

--- trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs	2013/03/16 17:41:52	180
+++ trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs	2013/03/16 17:56:55	181
@@ -235,9 +235,12 @@
             public IProgramDefinition AsXMLTVProgramDefinition(ISQLLITE sqllite)
             {
                 ProgramList.ProgramDefintion definition = new ProgramList.ProgramDefintion();
+
                 var channel = sqllite.Channels.Find(s => s.oid == this.channel_oid);
-                definition.ChannelName = channel.display_name;
-                definition.ChannelNumber = (int)channel.channel_number;
+                var channelname = channel.display_name;
+                var split = channelname.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
+                definition.ChannelNumber = Convert.ToInt32(split.First());
+                definition.ChannelName = string.IsNullOrEmpty(split.Last()) ? string.Empty : split.Last().ToString();
                 definition.Description = this.description;
                 definition.Start = this.start_time.ToDateTimeString();
                 definition.Stop = this.end_time.ToDateTimeString();
@@ -339,12 +342,9 @@
                     else
                     {
                         // data is the same
-                        if (Debugger.IsAttached)
-                        {
-                            Debugger.Break();
-                        }
                     }
                 }
+                index++;
             }
 
             #region old-code

 

  ViewVC Help
Powered by ViewVC 1.1.22