move a computation out of transaction and skip season updates if name matches

This commit is contained in:
cvium
2023-08-23 12:15:21 +02:00
parent 7e4e715a90
commit 9a246166b0
2 changed files with 10 additions and 2 deletions

View File

@@ -564,11 +564,12 @@ namespace Emby.Server.Implementations.Data
CheckDisposed();
var images = SerializeImages(item.ImageInfos);
using var connection = GetConnection();
using var transaction = connection.BeginTransaction();
using var saveImagesStatement = PrepareStatement(connection, "Update TypedBaseItems set Images=@Images where guid=@Id");
saveImagesStatement.TryBind("@Id", item.Id);
saveImagesStatement.TryBind("@Images", SerializeImages(item.ImageInfos));
saveImagesStatement.TryBind("@Images", images);
saveImagesStatement.ExecuteNonQuery();
transaction.Commit();