pull person sort order from tvdb/tmdb data

This commit is contained in:
Luke Pulverenti
2013-11-19 22:15:48 -05:00
parent de339b8265
commit bce86c5022
14 changed files with 109 additions and 24 deletions

View File

@@ -845,7 +845,7 @@ namespace MediaBrowser.Providers.Movies
//actors come from cast
if (movieData.casts != null && movieData.casts.cast != null)
{
foreach (var actor in movieData.casts.cast.OrderBy(a => a.order)) movie.AddPerson(new PersonInfo { Name = actor.name.Trim(), Role = actor.character, Type = PersonType.Actor });
foreach (var actor in movieData.casts.cast.OrderBy(a => a.order)) movie.AddPerson(new PersonInfo { Name = actor.name.Trim(), Role = actor.character, Type = PersonType.Actor, SortOrder = actor.order });
}
//and the rest from crew

View File

@@ -301,9 +301,13 @@ namespace MediaBrowser.Providers.Savers
builder.Append("<Website>" + SecurityElement.Escape(item.HomePageUrl) + "</Website>");
}
if (!string.IsNullOrEmpty(item.AspectRatio))
var hasAspectRatio = item as IHasAspectRatio;
if (hasAspectRatio != null)
{
builder.Append("<AspectRatio>" + SecurityElement.Escape(item.AspectRatio) + "</AspectRatio>");
if (!string.IsNullOrEmpty(hasAspectRatio.AspectRatio))
{
builder.Append("<AspectRatio>" + SecurityElement.Escape(hasAspectRatio.AspectRatio) + "</AspectRatio>");
}
}
if (!string.IsNullOrEmpty(item.Language))

View File

@@ -1056,6 +1056,23 @@ namespace MediaBrowser.Providers.TV
break;
}
case "SortOrder":
{
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
int rval;
// int.TryParse is local aware, so it can be probamatic, force us culture
if (int.TryParse(val, NumberStyles.Integer, UsCulture, out rval))
{
personInfo.SortOrder = rval;
}
}
break;
}
default:
reader.Skip();
break;