From 449cb05f7b51d2d0e64406617b5cc3472c8836e8 Mon Sep 17 00:00:00 2001 From: Eric Reed Date: Tue, 30 Apr 2013 11:25:30 -0400 Subject: Fix dup Actor node in xml and add role consolidation --- MediaBrowser.Controller/Entities/BaseItem.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Controller/Entities/BaseItem.cs') diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 0479259e5..4c8c7f3b7 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1169,11 +1169,18 @@ namespace MediaBrowser.Controller.Entities if (string.Equals(person.Type, PersonType.Actor, StringComparison.OrdinalIgnoreCase)) { - // Only add actors if there isn't an existing one of type Actor or GuestStar - if (!People.Any(p => p.Name.Equals(person.Name, StringComparison.OrdinalIgnoreCase) && (p.Type.Equals(PersonType.Actor, StringComparison.OrdinalIgnoreCase) || p.Type.Equals(PersonType.GuestStar, StringComparison.OrdinalIgnoreCase)))) + // If the actor already exists without a role and we have one, fill it in + var existing = People.FirstOrDefault(p => p.Name.Equals(person.Name, StringComparison.OrdinalIgnoreCase) && (p.Type.Equals(PersonType.Actor, StringComparison.OrdinalIgnoreCase) || p.Type.Equals(PersonType.GuestStar, StringComparison.OrdinalIgnoreCase))); + if (existing == null) { + // Wasn't there - add it People.Add(person); } + 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; + } } else { -- cgit v1.2.3