Merge pull request #10881 from TelepathicWalrus/fix-livetv-delay
Fix long live tv load times, Fixes #10761
This commit is contained in:
commit
a2fdec4363
|
@ -48,20 +48,23 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (!string.IsNullOrEmpty(cacheKey))
|
||||
{
|
||||
FileStream jsonStream = AsyncFile.OpenRead(cacheFilePath);
|
||||
try
|
||||
{
|
||||
mediaInfo = await JsonSerializer.DeserializeAsync<MediaInfo>(jsonStream, _jsonOptions, cancellationToken).ConfigureAwait(false);
|
||||
FileStream jsonStream = AsyncFile.OpenRead(cacheFilePath);
|
||||
|
||||
// _logger.LogDebug("Found cached media info");
|
||||
await using (jsonStream.ConfigureAwait(false))
|
||||
{
|
||||
mediaInfo = await JsonSerializer.DeserializeAsync<MediaInfo>(jsonStream, _jsonOptions, cancellationToken).ConfigureAwait(false);
|
||||
// _logger.LogDebug("Found cached media info");
|
||||
}
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
_logger.LogDebug(ex, "Could not open cached media info");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error deserializing mediainfo cache");
|
||||
}
|
||||
finally
|
||||
{
|
||||
await jsonStream.DisposeAsync().ConfigureAwait(false);
|
||||
_logger.LogError(ex, "Error opening cached media info");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user