aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Library')
-rw-r--r--Emby.Server.Implementations/Library/LiveStreamHelper.cs4
-rw-r--r--Emby.Server.Implementations/Library/MediaSourceManager.cs4
2 files changed, 4 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Library/LiveStreamHelper.cs b/Emby.Server.Implementations/Library/LiveStreamHelper.cs
index ad7988fb1..3ceba0fe9 100644
--- a/Emby.Server.Implementations/Library/LiveStreamHelper.cs
+++ b/Emby.Server.Implementations/Library/LiveStreamHelper.cs
@@ -46,8 +46,8 @@ namespace Emby.Server.Implementations.Library
{
try
{
- var jsonString = await File.ReadAllTextAsync(cacheFilePath, cancellationToken).ConfigureAwait(false);
- JsonSerializer.Deserialize<MediaInfo>(jsonString, JsonDefaults.GetOptions());
+ await using FileStream jsonStream = File.OpenRead(cacheFilePath);
+ await JsonSerializer.DeserializeAsync<MediaInfo>(jsonStream, JsonDefaults.GetOptions(), cancellationToken).ConfigureAwait(false);
// _logger.LogDebug("Found cached media info");
}
diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.cs
index 264390dd3..b3900e4aa 100644
--- a/Emby.Server.Implementations/Library/MediaSourceManager.cs
+++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs
@@ -641,8 +641,8 @@ namespace Emby.Server.Implementations.Library
{
try
{
- var json = await File.ReadAllTextAsync(cacheFilePath, cancellationToken).ConfigureAwait(false);
- mediaInfo = JsonSerializer.Deserialize<MediaInfo>(json, JsonDefaults.GetOptions());
+ await using FileStream jsonStream = File.OpenRead(cacheFilePath);
+ mediaInfo = await JsonSerializer.DeserializeAsync<MediaInfo>(jsonStream, JsonDefaults.GetOptions(), cancellationToken).ConfigureAwait(false);
// _logger.LogDebug("Found cached media info");
}