aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-04 15:06:09 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-04 15:06:09 -0400
commitef60822122d83343d709c1b804460d8c32c125ab (patch)
tree6dd76f002f58189022d4f1c1c1f7a8bfcea233a7
parent18f2993627728847a384c970edb1ec4d0ad32b0d (diff)
#26 - Cast/crew order should honour tags
-rw-r--r--MediaBrowser.Api/UserLibrary/PersonsService.cs9
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>