aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/BaseItem.cs
diff options
context:
space:
mode:
authorEric Reed <ebr@mediabrowser3.com>2013-04-30 11:25:30 -0400
committerEric Reed <ebr@mediabrowser3.com>2013-04-30 11:25:30 -0400
commit449cb05f7b51d2d0e64406617b5cc3472c8836e8 (patch)
tree9b751a0fdfd41ed1b40a9b04c93da47a2c7d1a7b /MediaBrowser.Controller/Entities/BaseItem.cs
parent3a3932bfbb3b8c353b7a2eee33c3b909d0741de7 (diff)
Fix dup Actor node in xml and add role consolidation
Diffstat (limited to 'MediaBrowser.Controller/Entities/BaseItem.cs')
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs11
1 files changed, 9 insertions, 2 deletions
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
{