2012-09-10 21:34:02 -04:00
|
|
|
|
using MediaBrowser.Controller.Entities.TV;
|
|
|
|
|
using MediaBrowser.Model.Entities;
|
2012-09-08 15:05:18 -04:00
|
|
|
|
using System;
|
2012-07-12 02:55:27 -04:00
|
|
|
|
using System.Xml;
|
|
|
|
|
|
2012-09-08 15:05:18 -04:00
|
|
|
|
namespace MediaBrowser.Controller.Providers.TV
|
2012-07-12 02:55:27 -04:00
|
|
|
|
{
|
|
|
|
|
public class SeriesXmlParser : BaseItemXmlParser<Series>
|
|
|
|
|
{
|
2012-08-20 17:48:11 -04:00
|
|
|
|
protected override void FetchDataFromXmlNode(XmlReader reader, Series item)
|
2012-07-12 02:55:27 -04:00
|
|
|
|
{
|
2012-07-14 16:45:11 -04:00
|
|
|
|
switch (reader.Name)
|
2012-07-12 02:55:27 -04:00
|
|
|
|
{
|
|
|
|
|
case "id":
|
2012-08-20 17:48:11 -04:00
|
|
|
|
string id = reader.ReadElementContentAsString();
|
2012-08-15 09:20:29 -04:00
|
|
|
|
if (!string.IsNullOrWhiteSpace(id))
|
|
|
|
|
{
|
|
|
|
|
item.SetProviderId(MetadataProviders.Tvdb, id);
|
|
|
|
|
}
|
2012-07-12 02:55:27 -04:00
|
|
|
|
break;
|
|
|
|
|
|
2012-07-20 10:47:39 -04:00
|
|
|
|
case "Airs_DayOfWeek":
|
2012-07-20 15:03:11 -04:00
|
|
|
|
{
|
2012-08-20 17:48:11 -04:00
|
|
|
|
string day = reader.ReadElementContentAsString();
|
2012-07-20 15:03:11 -04:00
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(day))
|
|
|
|
|
{
|
|
|
|
|
if (day.Equals("Daily", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
item.AirDays = new DayOfWeek[] {
|
|
|
|
|
DayOfWeek.Sunday,
|
|
|
|
|
DayOfWeek.Monday,
|
|
|
|
|
DayOfWeek.Tuesday,
|
|
|
|
|
DayOfWeek.Wednesday,
|
|
|
|
|
DayOfWeek.Thursday,
|
|
|
|
|
DayOfWeek.Friday,
|
|
|
|
|
DayOfWeek.Saturday
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
item.AirDays = new DayOfWeek[] {
|
|
|
|
|
(DayOfWeek)Enum.Parse(typeof(DayOfWeek), day, true)
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
2012-07-20 10:47:39 -04:00
|
|
|
|
|
|
|
|
|
case "Airs_Time":
|
2012-08-20 17:48:11 -04:00
|
|
|
|
item.AirTime = reader.ReadElementContentAsString();
|
2012-07-20 10:47:39 -04:00
|
|
|
|
break;
|
|
|
|
|
|
2012-07-12 02:55:27 -04:00
|
|
|
|
case "SeriesName":
|
2012-08-20 17:48:11 -04:00
|
|
|
|
item.Name = reader.ReadElementContentAsString();
|
2012-07-12 02:55:27 -04:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case "Status":
|
2012-08-20 17:48:11 -04:00
|
|
|
|
item.Status = reader.ReadElementContentAsString();
|
2012-07-12 02:55:27 -04:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2012-08-20 17:48:11 -04:00
|
|
|
|
base.FetchDataFromXmlNode(reader, item);
|
2012-07-12 02:55:27 -04:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|