mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 02:33:33 +01:00
Use embedded query
This commit is contained in:
@@ -266,10 +266,11 @@ public sealed class MovieSimilarItemsProvider : ILocalSimilarItemsProvider<Movie
|
|||||||
|
|
||||||
if (personSourceRows.Count > 0)
|
if (personSourceRows.Count > 0)
|
||||||
{
|
{
|
||||||
var allPersonIds = personSourceRows.Select(r => r.PeopleId).Distinct().ToList();
|
|
||||||
|
|
||||||
var personCandidateRows = await context.PeopleBaseItemMap.AsNoTracking()
|
var personCandidateRows = await context.PeopleBaseItemMap.AsNoTracking()
|
||||||
.Where(m => allPersonIds.Contains(m.PeopleId))
|
.Where(m => context.PeopleBaseItemMap
|
||||||
|
.Where(s => sourceIds.Contains(s.ItemId) && _scoredPersonTypes.Contains(s.People.PersonType))
|
||||||
|
.Select(s => s.PeopleId)
|
||||||
|
.Contains(m.PeopleId))
|
||||||
.Select(m => new { m.ItemId, m.PeopleId })
|
.Select(m => new { m.ItemId, m.PeopleId })
|
||||||
.ToListAsync(cancellationToken).ConfigureAwait(false);
|
.ToListAsync(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user