mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-13 08:37:07 +00:00
Apply review comments
This commit is contained in:
parent
98bbc26c5e
commit
acaeba11f3
2 changed files with 7 additions and 10 deletions
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue