parse budget and revenue from xml
This commit is contained in:
parent
840b1cb3d9
commit
a55e151054
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Controller.Entities;
|
||||
using System.Globalization;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
|
@ -75,6 +76,8 @@ namespace MediaBrowser.Controller.Providers
|
|||
}
|
||||
}
|
||||
|
||||
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
||||
|
||||
/// <summary>
|
||||
/// Fetches metadata from one Xml Element
|
||||
/// </summary>
|
||||
|
@ -106,6 +109,28 @@ namespace MediaBrowser.Controller.Providers
|
|||
item.DisplayMediaType = type;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case "Budget":
|
||||
{
|
||||
var text = reader.ReadElementContentAsString();
|
||||
double value;
|
||||
if (double.TryParse(text, NumberStyles.Any, _usCulture, out value))
|
||||
{
|
||||
item.Budget = value;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case "Revenue":
|
||||
{
|
||||
var text = reader.ReadElementContentAsString();
|
||||
double value;
|
||||
if (double.TryParse(text, NumberStyles.Any, _usCulture, out value))
|
||||
{
|
||||
item.Revenue = value;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case "SortTitle":
|
||||
|
|
Loading…
Reference in New Issue
Block a user