move people page into main editor

This commit is contained in:
Luke Pulverenti
2014-05-16 15:16:29 -04:00
parent 20bcc40e23
commit 26aa47eefd
13 changed files with 231 additions and 145 deletions

View File

@@ -62,34 +62,6 @@ namespace MediaBrowser.Controller.Providers
ValidationType = ValidationType.None
};
var hasTaglines = item as IHasTaglines;
if (hasTaglines != null)
{
hasTaglines.Taglines.Clear();
}
item.Studios.Clear();
item.Genres.Clear();
item.People.Clear();
var hasTags = item as IHasTags;
if (hasTags != null)
{
hasTags.Tags.Clear();
}
var hasKeywords = item as IHasKeywords;
if (hasKeywords != null)
{
hasKeywords.Keywords.Clear();
}
var hasTrailers = item as IHasTrailers;
if (hasTrailers != null)
{
hasTrailers.RemoteTrailers.Clear();
}
//Fetch(item, metadataFile, settings, Encoding.GetEncoding("ISO-8859-1"), cancellationToken);
Fetch(item, metadataFile, settings, Encoding.UTF8, cancellationToken);
}
@@ -373,6 +345,15 @@ namespace MediaBrowser.Controller.Providers
break;
}
case "Countries":
{
using (var subtree = reader.ReadSubtree())
{
FetchFromCountriesNode(subtree, item);
}
break;
}
case "ContentRating":
case "MPAARating":
{
@@ -857,6 +838,42 @@ namespace MediaBrowser.Controller.Providers
}
}
private void FetchFromCountriesNode(XmlReader reader, T item)
{
reader.MoveToContent();
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element)
{
switch (reader.Name)
{
case "Country":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
var hasProductionLocations = item as IHasProductionLocations;
if (hasProductionLocations != null)
{
if (!string.IsNullOrWhiteSpace(val))
{
hasProductionLocations.AddProductionLocation(val);
}
}
}
break;
}
default:
reader.Skip();
break;
}
}
}
}
/// <summary>
/// Fetches from taglines node.
/// </summary>