Removing duplicated found by the metadataprovider

This commit is contained in:
Zoe Roux 2020-02-12 00:41:00 +01:00
parent 862b4a42a7
commit 4efceb4238

View File

@ -120,11 +120,12 @@ namespace Kyoo.Controllers
if (show != null)
return show;
show = await _metadataProvider.GetShowFromName(showTitle, showPath, library);
show.People = (await _metadataProvider.GetPeople(show, library)).Select(x =>
{
People existing = _libraryManager.GetPeopleBySlug(x.Slug);
return existing != null ? new PeopleLink(existing, x.Role, x.Type) : x;
}).ToList();
show.People = (await _metadataProvider.GetPeople(show, library)).GroupBy(x => x.Slug).Select(x => x.First())
.Select(x =>
{
People existing = _libraryManager.GetPeopleBySlug(x.Slug);
return existing != null ? new PeopleLink(existing, x.Role, x.Type) : x;
}).ToList();
return show;
}