aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/LiveStreamHelper.cs
diff options
context:
space:
mode:
authorTelepathicWalrus <tom19978@googlemail.com>2024-02-01 07:14:25 +0000
committerTelepathicWalrus <tom19978@googlemail.com>2024-02-01 07:14:25 +0000
commit7d6a03bad6b8baacb83625be32e708090722fe10 (patch)
tree1f6970f98f87d0513ac90397664dae6c939f0ddd /Emby.Server.Implementations/Library/LiveStreamHelper.cs
parent1d235205ae0a53fd7e584b6561dd0f0c6437f691 (diff)
Change nested try catch to using statement
Diffstat (limited to 'Emby.Server.Implementations/Library/LiveStreamHelper.cs')
-rw-r--r--Emby.Server.Implementations/Library/LiveStreamHelper.cs8
1 files changed, 1 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/Library/LiveStreamHelper.cs b/Emby.Server.Implementations/Library/LiveStreamHelper.cs
index d6530df2d..d4aeae41a 100644
--- a/Emby.Server.Implementations/Library/LiveStreamHelper.cs
+++ b/Emby.Server.Implementations/Library/LiveStreamHelper.cs
@@ -52,17 +52,11 @@ namespace Emby.Server.Implementations.Library
{
FileStream jsonStream = AsyncFile.OpenRead(cacheFilePath);
- try
+ await using (jsonStream.ConfigureAwait(false))
{
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");
- }
-
- await jsonStream.DisposeAsync().ConfigureAwait(false);
}
catch (IOException ex)
{