Parse FirstAired for tv series
This commit is contained in:
parent
2cab5712a7
commit
5803f951b5
|
@ -197,6 +197,24 @@ namespace MediaBrowser.Controller.Xml
|
|||
}
|
||||
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":
|
||||
FetchFromGenresNode(reader.ReadSubtree(), item);
|
||||
break;
|
||||
|
|
|
@ -40,24 +40,6 @@ namespace MediaBrowser.TV.Metadata
|
|||
item.Name = reader.ReadString();
|
||||
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:
|
||||
base.FetchDataFromXmlNode(reader, item);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user