mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-11 08:43:01 +01:00
store person sort order in xml
This commit is contained in:
@@ -1198,6 +1198,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
if (existing != null)
|
||||
{
|
||||
existing.Type = PersonType.GuestStar;
|
||||
existing.SortOrder = person.SortOrder ?? existing.SortOrder;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1214,16 +1215,29 @@ namespace MediaBrowser.Controller.Entities
|
||||
else
|
||||
{
|
||||
// Was there, if no role and we have one - fill it in
|
||||
if (string.IsNullOrWhiteSpace(existing.Role) && !string.IsNullOrWhiteSpace(person.Role)) existing.Role = person.Role;
|
||||
if (string.IsNullOrWhiteSpace(existing.Role) && !string.IsNullOrWhiteSpace(person.Role))
|
||||
{
|
||||
existing.Role = person.Role;
|
||||
}
|
||||
|
||||
existing.SortOrder = person.SortOrder ?? existing.SortOrder;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var existing = People.FirstOrDefault(p =>
|
||||
string.Equals(p.Name, person.Name, StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(p.Type, person.Type, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
// Check for dupes based on the combination of Name and Type
|
||||
if (!People.Any(p => string.Equals(p.Name, person.Name, StringComparison.OrdinalIgnoreCase) && string.Equals(p.Type, person.Type, StringComparison.OrdinalIgnoreCase)))
|
||||
if (existing == null)
|
||||
{
|
||||
People.Add(person);
|
||||
}
|
||||
else
|
||||
{
|
||||
existing.SortOrder = person.SortOrder ?? existing.SortOrder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user