aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Item/KeyframeRepository.cs
diff options
context:
space:
mode:
authorpokreman06 <112423673+pokreman06@users.noreply.github.com>2025-10-02 11:07:05 -0600
committerGitHub <noreply@github.com>2025-10-02 11:07:05 -0600
commit0b4854c5eff7c862d05f43048e08dd3a1a25efaa (patch)
treea4c417af05deef7878ab9342c85c506ad22e1ced /Jellyfin.Server.Implementations/Item/KeyframeRepository.cs
parentd6a1c8413c6a213f6e579246c1b85aad9b028b3a (diff)
parent0f42aa892e0a7fe2ac4e680e7647515af0909e5e (diff)
Merge branch 'jellyfin:master' into master
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 />