mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Fixed image save method transaction commit
This commit is contained in:
parent
43a2ec990c
commit
00c4f23276
@ -1195,10 +1195,11 @@ public sealed class BaseItemRepository(
|
||||
ArgumentNullException.ThrowIfNull(item);
|
||||
|
||||
var images = item.ImageInfos.Select(e => Map(item.Id, e));
|
||||
using var db = dbProvider.CreateDbContext();
|
||||
using var transaction = db.Database.BeginTransaction();
|
||||
db.BaseItemImageInfos.Where(e => e.ItemId == item.Id).ExecuteDelete();
|
||||
db.BaseItemImageInfos.AddRange(images);
|
||||
using var context = dbProvider.CreateDbContext();
|
||||
using var transaction = context.Database.BeginTransaction();
|
||||
context.BaseItemImageInfos.Where(e => e.ItemId == item.Id).ExecuteDelete();
|
||||
context.BaseItemImageInfos.AddRange(images);
|
||||
context.SaveChanges();
|
||||
transaction.Commit();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user