From fa97e8e183a214e9d4af83299cfb5e74bb78ce03 Mon Sep 17 00:00:00 2001 From: gnattu Date: Fri, 14 Feb 2025 11:19:24 +0800 Subject: [PATCH] Write only for query columns to EFCore db (#13542) * Write only for query columns to EFCore db. We currently don't write the columns that do not exist on the BaseItem class definition in db. However, columns like `CleanName` is still useful and being used by internal queries and current behavior would cause such query to return nothing. The only exception is the UserDataKey which is not even being used for internal query that can be omitted. * Update comment --- Jellyfin.Server.Implementations/Item/BaseItemRepository.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs index fa026214ba..c4f6bf5aa4 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs @@ -689,6 +689,7 @@ public sealed class BaseItemRepository entity.IndexNumber = dto.IndexNumber; entity.IsLocked = dto.IsLocked; entity.Name = dto.Name; + entity.CleanName = GetCleanValue(dto.Name); entity.OfficialRating = dto.OfficialRating; entity.Overview = dto.Overview; entity.ParentIndexNumber = dto.ParentIndexNumber; @@ -821,10 +822,9 @@ public sealed class BaseItemRepository entity.StartDate = hasStartDate.StartDate; } + entity.UnratedType = dto.GetBlockUnratedType().ToString(); + // Fields that are present in the DB but are never actually used - // dto.UnratedType = entity.UnratedType; - // dto.TopParentId = entity.TopParentId; - // dto.CleanName = entity.CleanName; // dto.UserDataKey = entity.UserDataKey; if (dto is Folder folder)