Parse FirstAired for tv series

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti 2012-08-04 09:33:23 -04:00
parent 2cab5712a7
commit 5803f951b5
2 changed files with 18 additions and 18 deletions

View File

@ -197,6 +197,24 @@ namespace MediaBrowser.Controller.Xml
} }
break; break;
case "FirstAired":
{
string firstAired = reader.ReadString();
if (!string.IsNullOrWhiteSpace(firstAired))
{
DateTime airDate;
if (DateTime.TryParse(firstAired, out airDate) && airDate.Year > 1850)
{
item.PremiereDate = airDate;
item.ProductionYear = airDate.Year;
}
}
break;
}
case "Genres": case "Genres":
FetchFromGenresNode(reader.ReadSubtree(), item); FetchFromGenresNode(reader.ReadSubtree(), item);
break; break;

View File

@ -40,24 +40,6 @@ namespace MediaBrowser.TV.Metadata
item.Name = reader.ReadString(); item.Name = reader.ReadString();
break; break;
case "FirstAired":
{
string firstAired = reader.ReadString();
if (!string.IsNullOrWhiteSpace(firstAired))
{
DateTime airDate;
if (DateTime.TryParse(firstAired, out airDate) && airDate.Year > 1850)
{
item.PremiereDate = airDate;
item.ProductionYear = airDate.Year;
}
}
break;
}
default: default:
base.FetchDataFromXmlNode(reader, item); base.FetchDataFromXmlNode(reader, item);
break; break;