mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Change nested try catch to using statement
This commit is contained in:
parent
1d235205ae
commit
7d6a03bad6
@ -52,17 +52,11 @@ namespace Emby.Server.Implementations.Library
|
|||||||
{
|
{
|
||||||
FileStream jsonStream = AsyncFile.OpenRead(cacheFilePath);
|
FileStream jsonStream = AsyncFile.OpenRead(cacheFilePath);
|
||||||
|
|
||||||
try
|
await using (jsonStream.ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
mediaInfo = await JsonSerializer.DeserializeAsync<MediaInfo>(jsonStream, _jsonOptions, cancellationToken).ConfigureAwait(false);
|
mediaInfo = await JsonSerializer.DeserializeAsync<MediaInfo>(jsonStream, _jsonOptions, cancellationToken).ConfigureAwait(false);
|
||||||
// _logger.LogDebug("Found cached media info");
|
// _logger.LogDebug("Found cached media info");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Error deserializing mediainfo cache");
|
|
||||||
}
|
|
||||||
|
|
||||||
await jsonStream.DisposeAsync().ConfigureAwait(false);
|
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user