minor bug fixes (#1225)
This commit is contained in:
@@ -86,10 +86,20 @@ public class GetChannelFramerateHandler : IRequestHandler<GetChannelFramerate, O
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogInformation(
|
if (distinct.Any())
|
||||||
"All content on channel {ChannelNumber} has the same frame rate of {FrameRate}; will not normalize",
|
{
|
||||||
request.ChannelNumber,
|
_logger.LogInformation(
|
||||||
distinct[0]);
|
"All content on channel {ChannelNumber} has the same frame rate of {FrameRate}; will not normalize",
|
||||||
|
request.ChannelNumber,
|
||||||
|
distinct[0]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_logger.LogInformation(
|
||||||
|
"No content on channel {ChannelNumber} has frame rate information; will not normalize",
|
||||||
|
request.ChannelNumber);
|
||||||
|
}
|
||||||
|
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public abstract class CallLibraryScannerHandler<TRequest>
|
|||||||
return BaseError.New($"ErsatzTV.Scanner exited with code {process.ExitCode}");
|
return BaseError.New($"ErsatzTV.Scanner exited with code {process.ExitCode}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException)
|
catch (Exception ex) when (ex is TaskCanceledException or OperationCanceledException)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,31 +67,38 @@ public class HlsSessionWorker : IHlsSessionWorker
|
|||||||
DateTimeOffset filterBefore,
|
DateTimeOffset filterBefore,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var sw = Stopwatch.StartNew();
|
|
||||||
await Slim.WaitAsync(cancellationToken);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Option<string[]> maybeLines = await ReadPlaylistLines(cancellationToken);
|
var sw = Stopwatch.StartNew();
|
||||||
foreach (string[] input in maybeLines)
|
await Slim.WaitAsync(cancellationToken);
|
||||||
|
try
|
||||||
{
|
{
|
||||||
TrimPlaylistResult trimResult = _hlsPlaylistFilter.TrimPlaylist(PlaylistStart, filterBefore, input);
|
Option<string[]> maybeLines = await ReadPlaylistLines(cancellationToken);
|
||||||
if (DateTimeOffset.Now > _lastDelete.AddSeconds(30))
|
foreach (string[] input in maybeLines)
|
||||||
{
|
{
|
||||||
DeleteOldSegments(trimResult);
|
TrimPlaylistResult trimResult = _hlsPlaylistFilter.TrimPlaylist(PlaylistStart, filterBefore, input);
|
||||||
_lastDelete = DateTimeOffset.Now;
|
if (DateTimeOffset.Now > _lastDelete.AddSeconds(30))
|
||||||
|
{
|
||||||
|
DeleteOldSegments(trimResult);
|
||||||
|
_lastDelete = DateTimeOffset.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
return trimResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
return trimResult;
|
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
return None;
|
{
|
||||||
|
Slim.Release();
|
||||||
|
sw.Stop();
|
||||||
|
// _logger.LogDebug("TrimPlaylist took {Duration}", sw.Elapsed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finally
|
catch (Exception ex) when (ex is TaskCanceledException or OperationCanceledException)
|
||||||
{
|
{
|
||||||
Slim.Release();
|
// do nothing
|
||||||
sw.Stop();
|
|
||||||
// _logger.LogDebug("TrimPlaylist took {Duration}", sw.Elapsed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlayoutUpdated()
|
public void PlayoutUpdated()
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class EmbyApiClient : IEmbyApiClient
|
|||||||
return await service.GetSystemInformation(apiKey, cts.Token)
|
return await service.GetSystemInformation(apiKey, cts.Token)
|
||||||
.Map(response => new EmbyServerInformation(response.ServerName, response.OperatingSystem));
|
.Map(response => new EmbyServerInformation(response.ServerName, response.OperatingSystem));
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException ex)
|
catch (Exception ex) when (ex is TaskCanceledException or OperationCanceledException)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Timeout getting emby server name");
|
_logger.LogError(ex, "Timeout getting emby server name");
|
||||||
return BaseError.New("Emby did not respond in time");
|
return BaseError.New("Emby did not respond in time");
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public class JellyfinApiClient : IJellyfinApiClient
|
|||||||
return await service.GetSystemInformation(apiKey, cts.Token)
|
return await service.GetSystemInformation(apiKey, cts.Token)
|
||||||
.Map(response => new JellyfinServerInformation(response.ServerName, response.OperatingSystem));
|
.Map(response => new JellyfinServerInformation(response.ServerName, response.OperatingSystem));
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException ex)
|
catch (Exception ex) when (ex is TaskCanceledException or OperationCanceledException)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Timeout getting jellyfin server name");
|
_logger.LogError(ex, "Timeout getting jellyfin server name");
|
||||||
return BaseError.New("Jellyfin did not respond in time");
|
return BaseError.New("Jellyfin did not respond in time");
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
PagedTraktListsViewModel data = await _mediator.Send(new GetPagedTraktLists(state.Page, state.PageSize), _cts.Token);
|
PagedTraktListsViewModel data = await _mediator.Send(new GetPagedTraktLists(state.Page, state.PageSize), _cts.Token);
|
||||||
return new TableData<TraktListViewModel> { TotalItems = data.TotalCount, Items = data.Page };
|
return new TableData<TraktListViewModel> { TotalItems = data.TotalCount, Items = data.Page };
|
||||||
}
|
}
|
||||||
catch (Exception ex) when (ex is TaskCanceledException or OperationCanceledException)
|
catch (Exception ex) when (ex is TaskCanceledException or OperationCanceledException or AggregateException)
|
||||||
{
|
{
|
||||||
return new TableData<TraktListViewModel>
|
return new TableData<TraktListViewModel>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user