/[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/15 16:57:50	164
+++ trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs	2013/03/15 17:33:15	165
@@ -7,6 +7,8 @@
 using System.Diagnostics;
 using Enterprise.Logging;
 using libxmltv;
+using libxmltv.Interfaces;
+using libxmltv.Core;
 namespace GBPVRProgramDatabaseFixer
 {
     public interface ISQLLITE
@@ -198,6 +200,8 @@
             Int64 channel_oid { get; }
             String unique_identifier { get; }
             String rating { get; }
+
+            IProgramDefinition AsXMLTVProgramDefinition(ISQLLITE sqllite);
         }
         private class PROGRAMME : IPROGRAMME
         {
@@ -220,6 +224,19 @@
             public Int64 channel_oid { get; set; }
             public String unique_identifier { get; set; }
             public String rating { get; set; }
+            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;
+                definition.Description = this.description;
+                definition.Start = this.start_time.ToString("");
+                definition.Stop = this.end_time.ToString("");
+                definition.SubTitle = this.sub_title;
+                definition.Title = this.name;
+                return definition;
+            }
             #endregion
         }
         #endregion

 

  ViewVC Help
Powered by ViewVC 1.1.22