mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-03 21:54:26 -04:00
fix Missing metadata search where cast has multiple roles
This commit is contained in:
parent
9eb2044eae
commit
78d9fa72e0
@ -1151,13 +1151,24 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
target = new List<PersonInfo>();
|
target = new List<PersonInfo>();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var person in target)
|
var sourceByName = source.ToLookup(p => p.Name.RemoveDiacritics(), StringComparer.OrdinalIgnoreCase);
|
||||||
{
|
var targetByName = target.ToLookup(p => p.Name.RemoveDiacritics(), StringComparer.OrdinalIgnoreCase);
|
||||||
var normalizedName = person.Name.RemoveDiacritics();
|
|
||||||
var personInSource = source.FirstOrDefault(i => string.Equals(i.Name.RemoveDiacritics(), normalizedName, StringComparison.OrdinalIgnoreCase));
|
|
||||||
|
|
||||||
if (personInSource is not null)
|
foreach (var name in targetByName.Select(g => g.Key))
|
||||||
|
{
|
||||||
|
var targetPeople = targetByName[name].ToArray();
|
||||||
|
var sourcePeople = sourceByName[name].ToArray();
|
||||||
|
|
||||||
|
if (sourcePeople.Length == 0)
|
||||||
{
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < targetPeople.Length; i++)
|
||||||
|
{
|
||||||
|
var person = targetPeople[i];
|
||||||
|
var personInSource = i < sourcePeople.Length ? sourcePeople[i] : sourcePeople[0];
|
||||||
|
|
||||||
foreach (var providerId in personInSource.ProviderIds)
|
foreach (var providerId in personInSource.ProviderIds)
|
||||||
{
|
{
|
||||||
person.ProviderIds.TryAdd(providerId.Key, providerId.Value);
|
person.ProviderIds.TryAdd(providerId.Key, providerId.Value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user