diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-04-04 15:06:09 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-04-04 15:06:09 -0400 |
| commit | ef60822122d83343d709c1b804460d8c32c125ab (patch) | |
| tree | 6dd76f002f58189022d4f1c1c1f7a8bfcea233a7 | |
| parent | 18f2993627728847a384c970edb1ec4d0ad32b0d (diff) | |
#26 - Cast/crew order should honour tags
| -rw-r--r-- | MediaBrowser.Api/UserLibrary/PersonsService.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/MediaBrowser.Api/UserLibrary/PersonsService.cs b/MediaBrowser.Api/UserLibrary/PersonsService.cs index 0c6f807bf..7dcb24a54 100644 --- a/MediaBrowser.Api/UserLibrary/PersonsService.cs +++ b/MediaBrowser.Api/UserLibrary/PersonsService.cs @@ -86,9 +86,14 @@ namespace MediaBrowser.Api.UserLibrary /// <returns>IEnumerable{PersonInfo}.</returns> private IEnumerable<PersonInfo> GetAllPeople(IEnumerable<BaseItem> itemsList, string[] personTypes) { + var people = itemsList.SelectMany(i => i.People.OrderBy(p => p.Type)); + + return personTypes.Length == 0 ? - itemsList.SelectMany(i => i.People) : - itemsList.SelectMany(i => i.People.Where(p => personTypes.Contains(p.Type ?? string.Empty, StringComparer.OrdinalIgnoreCase))); + + people : + + people.Where(p => personTypes.Contains(p.Type ?? string.Empty, StringComparer.OrdinalIgnoreCase)); } /// <summary> |
