Added support for RunningTime in metadata
This commit is contained in:
parent
7835d690a1
commit
d4d2e85486
|
@ -129,6 +129,22 @@ namespace MediaBrowser.Controller.Xml
|
|||
item.CustomRating = reader.ReadString();
|
||||
break;
|
||||
|
||||
case "Runtime":
|
||||
case "RunningTime":
|
||||
{
|
||||
string text = reader.ReadString();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
int runtime;
|
||||
if (int.TryParse(text.Split(' ')[0], out runtime))
|
||||
{
|
||||
item.RunTimeTicks = TimeSpan.FromMinutes(runtime).Ticks;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "Genre":
|
||||
{
|
||||
var genres = (item.Genres ?? new string[] { }).ToList();
|
||||
|
@ -183,12 +199,17 @@ namespace MediaBrowser.Controller.Xml
|
|||
break;
|
||||
|
||||
case "ProductionYear":
|
||||
{
|
||||
string val = reader.ReadString();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(val))
|
||||
{
|
||||
int ProductionYear;
|
||||
if (int.TryParse(reader.ReadString(), out ProductionYear) && ProductionYear > 1850)
|
||||
if (int.TryParse(val, out ProductionYear) && ProductionYear > 1850)
|
||||
{
|
||||
item.ProductionYear = ProductionYear;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -61,22 +61,6 @@ namespace MediaBrowser.TV.Metadata
|
|||
item.Status = reader.ReadString();
|
||||
break;
|
||||
|
||||
case "Runtime":
|
||||
{
|
||||
string text = reader.ReadString();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
|
||||
int runtime;
|
||||
if (int.TryParse(text.Split(' ')[0], out runtime))
|
||||
{
|
||||
item.RunTimeTicks = TimeSpan.FromMinutes(runtime).Ticks;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
base.FetchDataFromXmlNode(reader, item);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue
Block a user