The Free Software Media System - Server Backend & API
Optimize FavoritePersons query
crobiberob7443f6042e8
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.csindex 50c7a07d48..f7a6708c91 100644--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs@@ -5039,9 +5039,9 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Typeif (query.User != null && query.IsFavorite.HasValue){- commandText.Append(" LEFT JOIN TypedBaseItems tbi ON tbi.Name=p.Name AND tbi.Type='");+ commandText.Append(" INNER JOIN TypedBaseItems tbi ON tbi.Name=p.Name AND tbi.Type='");commandText.Append(typeof(Person).FullName);- commandText.Append("' LEFT JOIN UserDatas ON tbi.UserDataKey=key AND userId=@UserId");+ commandText.Append("' INNER JOIN UserDatas ON tbi.UserDataKey=key AND userId=@UserId");}var whereClauses = GetPeopleWhereClauses(query, null);