mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
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))
|
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 (IOException ex)
|
||||||
|
{
|
||||||
|
_logger.LogDebug(ex, "Could not open cached media info");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Error deserializing mediainfo cache");
|
_logger.LogError(ex, "Error opening cached media info");
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
await jsonStream.DisposeAsync().ConfigureAwait(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user