mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-16 14:03:03 +03:00
Fix contributing artist query (#14991)
This commit is contained in:
@@ -2014,7 +2014,7 @@ public sealed class BaseItemRepository
|
||||
|
||||
if (filter.ArtistIds.Length > 0)
|
||||
{
|
||||
baseQuery = baseQuery.WhereReferencedItem(context, ItemValueType.Artist, filter.ArtistIds);
|
||||
baseQuery = baseQuery.WhereReferencedItemMultipleTypes(context, [ItemValueType.Artist, ItemValueType.AlbumArtist], filter.ArtistIds);
|
||||
}
|
||||
|
||||
if (filter.AlbumArtistIds.Length > 0)
|
||||
@@ -2024,7 +2024,18 @@ public sealed class BaseItemRepository
|
||||
|
||||
if (filter.ContributingArtistIds.Length > 0)
|
||||
{
|
||||
baseQuery = baseQuery.WhereReferencedItem(context, ItemValueType.Artist, filter.ContributingArtistIds);
|
||||
var contributingNames = context.BaseItems
|
||||
.Where(b => filter.ContributingArtistIds.Contains(b.Id))
|
||||
.Select(b => b.CleanName);
|
||||
|
||||
baseQuery = baseQuery.Where(e =>
|
||||
e.ItemValues!.Any(ivm =>
|
||||
ivm.ItemValue.Type == ItemValueType.Artist &&
|
||||
contributingNames.Contains(ivm.ItemValue.CleanValue))
|
||||
&&
|
||||
!e.ItemValues!.Any(ivm =>
|
||||
ivm.ItemValue.Type == ItemValueType.AlbumArtist &&
|
||||
contributingNames.Contains(ivm.ItemValue.CleanValue)));
|
||||
}
|
||||
|
||||
if (filter.AlbumIds.Length > 0)
|
||||
|
||||
Reference in New Issue
Block a user