mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-03 04:42:52 +01:00
Apply review comments
This commit is contained in:
@@ -182,12 +182,6 @@ public class MediaSegmentManager : IMediaSegmentManager
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public async Task DeleteSegmentsAsync(Guid itemId, CancellationToken cancellationToken)
|
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)
|
foreach (var provider in _segmentProviders)
|
||||||
{
|
{
|
||||||
try
|
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);
|
_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 />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -40,8 +40,5 @@ public interface IMediaSegmentProvider
|
|||||||
/// <param name="itemId">The item whose data is being pruned.</param>
|
/// <param name="itemId">The item whose data is being pruned.</param>
|
||||||
/// <param name="cancellationToken">Abort token.</param>
|
/// <param name="cancellationToken">Abort token.</param>
|
||||||
/// <returns>A task representing the asynchronous cleanup operation.</returns>
|
/// <returns>A task representing the asynchronous cleanup operation.</returns>
|
||||||
Task CleanupExtractedData(Guid itemId, CancellationToken cancellationToken)
|
Task CleanupExtractedData(Guid itemId, CancellationToken cancellationToken);
|
||||||
{
|
|
||||||
return Task.CompletedTask;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user