mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-31 04:05:50 -04:00
Add ex to catch if cached mediainfo doesnt exist
This commit is contained in:
parent
d40224128c
commit
08592fb3fe
@ -48,21 +48,26 @@ 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);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
mediaInfo = await JsonSerializer.DeserializeAsync<MediaInfo>(jsonStream, _jsonOptions, cancellationToken).ConfigureAwait(false);
|
||||||
|
// _logger.LogDebug("Found cached media info");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Error deserializing mediainfo cache");
|
||||||
|
}
|
||||||
|
|
||||||
// _logger.LogDebug("Found cached media info");
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Error deserializing mediainfo cache");
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
await jsonStream.DisposeAsync().ConfigureAwait(false);
|
await jsonStream.DisposeAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
_logger.LogError("Could not open cached media info");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mediaInfo is null)
|
if (mediaInfo is null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user