Merge pull request #10881 from TelepathicWalrus/fix-livetv-delay

Fix long live tv load times, Fixes #10761
pull/10948/head
Bond-009 5 months ago committed by GitHub
commit a2fdec4363
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -48,20 +48,23 @@ namespace Emby.Server.Implementations.Library
if (!string.IsNullOrEmpty(cacheKey)) if (!string.IsNullOrEmpty(cacheKey))
{ {
FileStream jsonStream = AsyncFile.OpenRead(cacheFilePath);
try 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 (Exception ex) catch (IOException ex)
{ {
_logger.LogError(ex, "Error deserializing mediainfo cache"); _logger.LogDebug(ex, "Could not open cached media info");
} }
finally catch (Exception ex)
{ {
await jsonStream.DisposeAsync().ConfigureAwait(false); _logger.LogError(ex, "Error opening cached media info");
} }
} }

Loading…
Cancel
Save