aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Item/KeyframeRepository.cs
diff options
context:
space:
mode:
authorChristopher Young <c.t.ythegamer@gmail.com>2025-10-08 12:27:51 -0600
committerChristopher Young <c.t.ythegamer@gmail.com>2025-10-08 12:27:51 -0600
commit622b60064dd2c9bf6cea139ab2056011d9e9c203 (patch)
treeec9f84d01b7c3ff3ffd23e89bb27aa4bf4e131ff /Jellyfin.Server.Implementations/Item/KeyframeRepository.cs
parent91b2b7fc3dfe23fdc01834f2f1364e9f8bd98fe4 (diff)
parent0b4854c5eff7c862d05f43048e08dd3a1a25efaa (diff)
Merge branch 'master' of https://github.com/JadedRain/jellyfin
Diffstat (limited to 'Jellyfin.Server.Implementations/Item/KeyframeRepository.cs')
-rw-r--r--Jellyfin.Server.Implementations/Item/KeyframeRepository.cs13
1 files changed, 8 insertions, 5 deletions
diff --git a/Jellyfin.Server.Implementations/Item/KeyframeRepository.cs b/Jellyfin.Server.Implementations/Item/KeyframeRepository.cs
index 93c6f472e2..438458c6be 100644
--- a/Jellyfin.Server.Implementations/Item/KeyframeRepository.cs
+++ b/Jellyfin.Server.Implementations/Item/KeyframeRepository.cs
@@ -55,11 +55,14 @@ public class KeyframeRepository : IKeyframeRepository
public async Task SaveKeyframeDataAsync(Guid itemId, MediaEncoding.Keyframes.KeyframeData data, CancellationToken cancellationToken)
{
using var context = _dbProvider.CreateDbContext();
- using var transaction = await context.Database.BeginTransactionAsync(cancellationToken).ConfigureAwait(false);
- await context.KeyframeData.Where(e => e.ItemId.Equals(itemId)).ExecuteDeleteAsync(cancellationToken).ConfigureAwait(false);
- await context.KeyframeData.AddAsync(Map(data, itemId), cancellationToken).ConfigureAwait(false);
- await context.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
- await transaction.CommitAsync(cancellationToken).ConfigureAwait(false);
+ var transaction = await context.Database.BeginTransactionAsync(cancellationToken).ConfigureAwait(false);
+ await using (transaction.ConfigureAwait(false))
+ {
+ await context.KeyframeData.Where(e => e.ItemId.Equals(itemId)).ExecuteDeleteAsync(cancellationToken).ConfigureAwait(false);
+ await context.KeyframeData.AddAsync(Map(data, itemId), cancellationToken).ConfigureAwait(false);
+ await context.SaveChangesAsync(cancellationToken).ConfigureAwait(false);
+ await transaction.CommitAsync(cancellationToken).ConfigureAwait(false);
+ }
}
/// <inheritdoc />