mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-24 00:20:57 +01:00
pull person sort order from tvdb/tmdb data
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user