* Hotfix for the 10.10.2 API change

* Support 10.10.1 retroactively for now

* Log a message indicating the action
This commit is contained in:
TwistedUmbrellaX 2024-11-16 20:14:01 -05:00 committed by GitHub
parent 72366e93b9
commit 6bb54ab3a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,8 +39,17 @@ namespace IntroSkipper.Manager
cancellationToken.ThrowIfCancellationRequested();
try
{
try
{
var existingSegments = await _mediaSegmentManager.GetSegmentsAsync(episode.EpisodeId, null, true).ConfigureAwait(false);
await Task.WhenAll(existingSegments.Select(s => _mediaSegmentManager.DeleteSegmentAsync(s.Id))).ConfigureAwait(false);
}
catch (Exception vs)
{
_logger.LogError(vs, "GetSegmentsAsync failed. 10.10.1 compatibility enabled.");
var existingSegments = await _mediaSegmentManager.GetSegmentsAsync(episode.EpisodeId, null).ConfigureAwait(false);
await Task.WhenAll(existingSegments.Select(s => _mediaSegmentManager.DeleteSegmentAsync(s.Id))).ConfigureAwait(false);
}
var newSegments = await _segmentProvider.GetMediaSegments(new MediaSegmentGenerationRequest { ItemId = episode.EpisodeId }, cancellationToken).ConfigureAwait(false);