/[xmltv_parser]/trunk/libxmltv/Core/XMLTVProgramCollection.cs
ViewVC logotype

Diff of /trunk/libxmltv/Core/XMLTVProgramCollection.cs

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

--- trunk/libxmltv/Core/XMLTVProgramCollection.cs	2013/03/09 01:09:45	65
+++ trunk/libxmltv/Core/XMLTVProgramCollection.cs	2013/03/09 01:15:46	66
@@ -67,19 +67,19 @@
                 {
                     var start = c.Attribute(XMLTVConstants.Programs.ProgramStart);
                     program.Start = start == null ? new DateTime() : ParseDate(start.Value);
-                    xmltv_logger.Verbose.Debug.WriteLine("\tprogram_start: {0}", start);
+                    if (!program.Start.Equals(new DateTime())) { xmltv_logger.Verbose.Debug.WriteLine("\tprogram_start: {0}", start); }
 
                     var stop = c.Attribute(XMLTVConstants.Programs.ProgramStop);
                     program.Stop = stop == null ? new DateTime() : ParseDate(stop.Value);
-                    xmltv_logger.Verbose.Debug.WriteLine("\tprogram_stop: {0}", stop);
+                    if (!program.Stop.Equals(new DateTime())) { xmltv_logger.Verbose.Debug.WriteLine("\tprogram_stop: {0}", stop); }
 
                     var channelid = c.Attribute(XMLTVConstants.Programs.ProgramChannelId);
-                    xmltv_logger.Verbose.Debug.WriteLine("\tprogram_channelid: {0}", channelid);
+                    if (!string.IsNullOrEmpty(program.Description)){ xmltv_logger.Verbose.Debug.WriteLine("\tprogram_channelid: {0}", channelid);}
                     IXMLTVChannel channel = new Channel();
                     string _channelid = channelid == null ? string.Empty : channelid.Value;
                     if (instance.Channels.ContainsKey(_channelid)) { program.Channel = instance.Channels[_channelid]; }
                     else { program.Channel = new Channel(); }
-                    xmltv_logger.Verbose.Debug.WriteLine("\tprogram_channel: {0}", program.Channel.ToString());
+                    if (!string.IsNullOrEmpty(_channelid)) { xmltv_logger.Verbose.Debug.WriteLine("\tprogram_channel: {0}", program.Channel.ToString()); }
                 }
                 try
                 {
@@ -87,21 +87,21 @@
                     program.Title = title == null ? string.Empty : title.Value;         
                 }
                 catch (Exception) { program.Title = string.Empty; }
-                xmltv_logger.Verbose.Debug.WriteLine("\tprogram_title: {0}", program.Title == string.Empty ? "empty" : program.Title);
+                if (!string.IsNullOrEmpty(program.Title)) { xmltv_logger.Verbose.Debug.WriteLine("\tprogram_title: {0}", program.Title == string.Empty ? "empty" : program.Title); }
                 try
                 {
                     var subtitle = c.Descendants(XMLTVConstants.Programs.ProgramSubTitle).FirstOrDefault();
                     program.SubTitle = subtitle == null ? string.Empty : subtitle.Value;               
                 }
                 catch (Exception) { program.SubTitle = string.Empty; }
-                xmltv_logger.Verbose.Debug.WriteLine("\tprogram_subtitle: {0}", program.SubTitle == string.Empty ? "empty" : program.SubTitle);
+                if (!string.IsNullOrEmpty(program.SubTitle)) { xmltv_logger.Verbose.Debug.WriteLine("\tprogram_subtitle: {0}", program.SubTitle == string.Empty ? "empty" : program.SubTitle); }
                 try
                 {
                     var description = c.Descendants(XMLTVConstants.Programs.ProgramDescription).FirstOrDefault();
                     program.Description = description == null ? string.Empty : description.Value; ;                    
                 }
                 catch (Exception) { program.Description = string.Empty; }
-                xmltv_logger.Verbose.Debug.WriteLine("\tprogram_description: {0}", program.Description == string.Empty ? "empty" : program.Description);
+                if (!string.IsNullOrEmpty(program.Description)) { xmltv_logger.Verbose.Debug.WriteLine("\tprogram_description: {0}", program.Description == string.Empty ? "empty" : program.Description); }
 
                 entries.Add(program.Id, program);
                 

 

  ViewVC Help
Powered by ViewVC 1.1.22