aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Entities/PeopleHelper.cs17
-rw-r--r--MediaBrowser.Controller/Entities/Person.cs12
2 files changed, 25 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/Entities/PeopleHelper.cs b/MediaBrowser.Controller/Entities/PeopleHelper.cs
index 3468ca2d5..40a93d9e6 100644
--- a/MediaBrowser.Controller/Entities/PeopleHelper.cs
+++ b/MediaBrowser.Controller/Entities/PeopleHelper.cs
@@ -45,7 +45,7 @@ namespace MediaBrowser.Controller.Entities
if (existing != null)
{
existing.Type = PersonType.GuestStar;
- existing.SortOrder = person.SortOrder ?? existing.SortOrder;
+ MergeExisting(existing, person);
return;
}
}
@@ -67,7 +67,7 @@ namespace MediaBrowser.Controller.Entities
existing.Role = person.Role;
}
- existing.SortOrder = person.SortOrder ?? existing.SortOrder;
+ MergeExisting(existing, person);
}
}
else
@@ -83,11 +83,22 @@ namespace MediaBrowser.Controller.Entities
}
else
{
- existing.SortOrder = person.SortOrder ?? existing.SortOrder;
+ MergeExisting(existing, person);
}
}
}
+ private static void MergeExisting(PersonInfo existing, PersonInfo person)
+ {
+ existing.SortOrder = person.SortOrder ?? existing.SortOrder;
+ existing.ImageUrl = person.ImageUrl ?? existing.ImageUrl;
+
+ foreach (var id in person.ProviderIds)
+ {
+ existing.SetProviderId(id.Key, id.Value);
+ }
+ }
+
public static bool ContainsPerson(List<PersonInfo> people, string name)
{
if (string.IsNullOrWhiteSpace(name))
diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs
index 6c277da56..a365b99c6 100644
--- a/MediaBrowser.Controller/Entities/Person.cs
+++ b/MediaBrowser.Controller/Entities/Person.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
+using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.Entities
{
@@ -106,8 +107,13 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// This is the small Person stub that is attached to BaseItems
/// </summary>
- public class PersonInfo
+ public class PersonInfo : IHasProviderIds
{
+ public PersonInfo()
+ {
+ ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
+ }
+
public Guid ItemId { get; set; }
/// <summary>
@@ -132,6 +138,10 @@ namespace MediaBrowser.Controller.Entities
/// <value>The sort order.</value>
public int? SortOrder { get; set; }
+ public string ImageUrl { get; set; }
+
+ public Dictionary<string, string> ProviderIds { get; set; }
+
/// <summary>
/// Returns a <see cref="System.String" /> that represents this instance.
/// </summary>