diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-30 09:28:38 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-30 09:28:38 -0400 |
| commit | f0da58a997ed01635225ae5290d7f34997b99452 (patch) | |
| tree | 91cbf8c34aff65d1384a2e1277c3544aeb9e0c09 /MediaBrowser.Server.Implementations | |
| parent | 62d98551edf421ba50f2eadf95d6c3d1fb1d20ae (diff) | |
fix config startup
Diffstat (limited to 'MediaBrowser.Server.Implementations')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Dto/DtoService.cs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 6684c4efb..7f63dac33 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -423,7 +423,38 @@ namespace MediaBrowser.Server.Implementations.Dto // Ordering by person type to ensure actors and artists are at the front. // This is taking advantage of the fact that they both begin with A // This should be improved in the future - var people = item.People.OrderBy(i => i.SortOrder ?? int.MaxValue).ThenBy(i => i.Type).ToList(); + var people = item.People.OrderBy(i => i.SortOrder ?? int.MaxValue) + .ThenBy(i => + { + if (i.IsType(PersonType.Actor)) + { + return 0; + } + if (i.IsType(PersonType.GuestStar)) + { + return 1; + } + if (i.IsType(PersonType.Director)) + { + return 2; + } + if (i.IsType(PersonType.Writer)) + { + return 3; + } + if (i.IsType(PersonType.Producer)) + { + return 4; + } + if (i.IsType(PersonType.Composer)) + { + return 4; + } + + return 10; + }) + .ThenBy(i => i.Name) + .ToList(); // Attach People by transforming them into BaseItemPerson (DTO) dto.People = new BaseItemPerson[people.Count]; |
