mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-03 08:51:56 +01:00
Apply review comments
This commit is contained in:
@@ -182,12 +182,6 @@ public class MediaSegmentManager : IMediaSegmentManager
|
||||
/// <inheritdoc />
|
||||
public async Task DeleteSegmentsAsync(Guid itemId, CancellationToken cancellationToken)
|
||||
{
|
||||
var db = await _dbProvider.CreateDbContextAsync(cancellationToken).ConfigureAwait(false);
|
||||
await using (db.ConfigureAwait(false))
|
||||
{
|
||||
await db.MediaSegments.Where(e => e.ItemId.Equals(itemId)).ExecuteDeleteAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
foreach (var provider in _segmentProviders)
|
||||
{
|
||||
try
|
||||
@@ -199,6 +193,12 @@ public class MediaSegmentManager : IMediaSegmentManager
|
||||
_logger.LogError(ex, "Provider {ProviderName} failed to clean up extracted data for item {ItemId}", provider.Name, itemId);
|
||||
}
|
||||
}
|
||||
|
||||
var db = await _dbProvider.CreateDbContextAsync(cancellationToken).ConfigureAwait(false);
|
||||
await using (db.ConfigureAwait(false))
|
||||
{
|
||||
await db.MediaSegments.Where(e => e.ItemId.Equals(itemId)).ExecuteDeleteAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -40,8 +40,5 @@ public interface IMediaSegmentProvider
|
||||
/// <param name="itemId">The item whose data is being pruned.</param>
|
||||
/// <param name="cancellationToken">Abort token.</param>
|
||||
/// <returns>A task representing the asynchronous cleanup operation.</returns>
|
||||
Task CleanupExtractedData(Guid itemId, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
Task CleanupExtractedData(Guid itemId, CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user