2
0
Эх сурвалжийг харах

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
gnattu 4 сар өмнө
parent
commit
fa97e8e183

+ 3 - 3
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)