48 |
|
Program program = new Program(); |
49 |
|
|
50 |
|
program.Id = index; |
51 |
< |
|
51 |
> |
//XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("program_Id: {0}", program.Id); |
52 |
|
if (c.HasAttributes) |
53 |
|
{ |
54 |
|
var start = c.Attribute(XMLTV_CONSTANTS.Programs.ProgramStart).Value; |
55 |
|
program.Start = ParseDate(start); |
56 |
< |
|
56 |
> |
//XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_start: {0}", start); |
57 |
|
var stop = c.Attribute(XMLTV_CONSTANTS.Programs.ProgramStop).Value; |
58 |
|
program.Stop = ParseDate(stop); |
59 |
< |
|
59 |
> |
//XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_stop: {0}", stop); |
60 |
|
var channelid = c.Attribute(XMLTV_CONSTANTS.Programs.ProgramChannelId).Value; |
61 |
+ |
//XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_channelid: {0}", channelid); |
62 |
|
IXMLTVChannel channel = new Channel(); |
63 |
|
try |
64 |
|
{ |
65 |
|
channel = XMLTV_PARSER.Channels[channelid]; |
66 |
+ |
|
67 |
|
} |
68 |
|
catch (KeyNotFoundException) |
69 |
|
{ |
70 |
|
XMLTV_LOGGER.Log.Verbose.Error.WriteLine(string.Format("Unable to find Channel by id: '{0}' for this program.", channelid)); |
71 |
|
} |
72 |
|
program.Channel = channel; |
73 |
+ |
//XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_channel: {0}", program.Channel.ToString()); |
74 |
+ |
} |
75 |
+ |
try |
76 |
+ |
{ |
77 |
+ |
var title = c.Descendants(XMLTV_CONSTANTS.Programs.ProgramTitle).FirstOrDefault().Value; |
78 |
+ |
program.Title = title; |
79 |
+ |
} |
80 |
+ |
catch (Exception) { program.Title = string.Empty; } |
81 |
+ |
//XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_title: {0}", program.Title == string.Empty ? "empty" : program.Title); |
82 |
+ |
try |
83 |
+ |
{ |
84 |
+ |
var subtitle = c.Descendants(XMLTV_CONSTANTS.Programs.ProgramSubTitle).FirstOrDefault().Value; |
85 |
+ |
program.SubTitle = subtitle; |
86 |
+ |
} |
87 |
+ |
catch (Exception) { program.SubTitle = string.Empty; } |
88 |
+ |
//XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_subtitle: {0}", program.SubTitle == string.Empty ? "empty" : program.SubTitle); |
89 |
+ |
try |
90 |
+ |
{ |
91 |
+ |
var description = c.Descendants(XMLTV_CONSTANTS.Programs.ProgramDescription).FirstOrDefault().Value; |
92 |
+ |
program.Description = description; |
93 |
|
} |
94 |
< |
var title = c.Descendants(XMLTV_CONSTANTS.Programs.ProgramTitle).FirstOrDefault().Value; |
95 |
< |
program.Title = title; |
74 |
< |
var subtitle = c.Descendants(XMLTV_CONSTANTS.Programs.ProgramSubTitle).FirstOrDefault().Value; |
75 |
< |
program.SubTitle = subtitle; |
76 |
< |
var description = c.Descendants(XMLTV_CONSTANTS.Programs.ProgramDescription).FirstOrDefault().Value; |
77 |
< |
program.Description = description; |
94 |
> |
catch (Exception) { program.Description = string.Empty; } |
95 |
> |
//XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_description: {0}", program.Description == string.Empty ? "empty" : program.Description); |
96 |
|
|
97 |
|
entries.Add(program.Id, program); |
98 |
|
index++; |