Use streams instead of strings

This commit is contained in:
David
2020-12-23 19:24:58 +01:00
parent f38970cbd3
commit 2a574914ea
11 changed files with 24 additions and 30 deletions

View File

@@ -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");
}