diff --git a/Emby.Server.Implementations/Data/ItemTypeLookup.cs b/Emby.Server.Implementations/Data/ItemTypeLookup.cs
index 5504012bff..f5db28c7ac 100644
--- a/Emby.Server.Implementations/Data/ItemTypeLookup.cs
+++ b/Emby.Server.Implementations/Data/ItemTypeLookup.cs
@@ -22,10 +22,16 @@ namespace Emby.Server.Implementations.Data;
public class ItemTypeLookup : IItemTypeLookup
{
///
- public IReadOnlyList MusicGenreTypes => BaseItemKindNames.Where(e => e.Key is BaseItemKind.Audio or BaseItemKind.MusicVideo or BaseItemKind.MusicAlbum or BaseItemKind.MusicArtist).Select(e => e.Value).ToImmutableArray();
+ public IReadOnlyList MusicGenreTypes { get; } = [
+
+ typeof(Audio).FullName!,
+ typeof(MusicVideo).FullName!,
+ typeof(MusicAlbum).FullName!,
+ typeof(MusicArtist).FullName!,
+ ];
///
- public IDictionary BaseItemKindNames { get; } = new Dictionary()
+ public IReadOnlyDictionary BaseItemKindNames { get; } = new Dictionary()
{
{ BaseItemKind.AggregateFolder, typeof(AggregateFolder).FullName! },
{ BaseItemKind.Audio, typeof(Audio).FullName! },
diff --git a/Emby.Server.Implementations/Library/MusicManager.cs b/Emby.Server.Implementations/Library/MusicManager.cs
index 3f29099471..71c69ec50a 100644
--- a/Emby.Server.Implementations/Library/MusicManager.cs
+++ b/Emby.Server.Implementations/Library/MusicManager.cs
@@ -27,14 +27,7 @@ namespace Emby.Server.Implementations.Library
public IReadOnlyList GetInstantMixFromSong(Audio item, User? user, DtoOptions dtoOptions)
{
- var list = new List
- {
- item
- };
-
- list.AddRange(GetInstantMixFromGenres(item.Genres, user, dtoOptions));
-
- return [.. list];
+ return GetInstantMixFromGenres(item.Genres, user, dtoOptions);
}
///
diff --git a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs
index dee87f48f9..5f5bf09af9 100644
--- a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs
+++ b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs
@@ -16,10 +16,11 @@ namespace Jellyfin.Server.Implementations.Item;
/// Manager for handling people.
///
/// Efcore Factory.
+/// Items lookup service.
///
/// Initializes a new instance of the class.
///
-public class PeopleRepository(IDbContextFactory dbProvider) : IPeopleRepository
+public class PeopleRepository(IDbContextFactory dbProvider, IItemTypeLookup itemTypeLookup) : IPeopleRepository
{
private readonly IDbContextFactory _dbProvider = dbProvider;
@@ -118,8 +119,9 @@ public class PeopleRepository(IDbContextFactory dbProvider) :
{
if (filter.User is not null && filter.IsFavorite.HasValue)
{
- query = query.Where(e => e.PersonType == typeof(Person).FullName)
- .Where(e => context.BaseItems.Where(d => context.UserData.Where(e => e.IsFavorite == filter.IsFavorite && e.UserId.Equals(filter.User.Id)).Any(f => f.Key == d.UserDataKey))
+ var personType = itemTypeLookup.BaseItemKindNames[BaseItemKind.Person];
+ query = query.Where(e => e.PersonType == personType)
+ .Where(e => context.BaseItems.Where(d => context.UserData.Where(w => w.IsFavorite == filter.IsFavorite && w.UserId.Equals(filter.User.Id)).Any(f => f.Key == d.UserDataKey))
.Select(f => f.Name).Contains(e.Name));
}
diff --git a/MediaBrowser.Controller/Persistence/IItemTypeLookup.cs b/MediaBrowser.Controller/Persistence/IItemTypeLookup.cs
index d2c6ff365c..9507f79d33 100644
--- a/MediaBrowser.Controller/Persistence/IItemTypeLookup.cs
+++ b/MediaBrowser.Controller/Persistence/IItemTypeLookup.cs
@@ -18,5 +18,5 @@ public interface IItemTypeLookup
///
/// Gets mapping for all BaseItemKinds and their expected serialization target.
///
- public IDictionary BaseItemKindNames { get; }
+ public IReadOnlyDictionary BaseItemKindNames { get; }
}