diff options
| author | David <daullmer@gmail.com> | 2020-12-23 19:24:58 +0100 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2020-12-23 19:24:58 +0100 |
| commit | 2a574914eaca486f6216db400d9fdf88ad88636e (patch) | |
| tree | 760b7c769e71cfd88ff54282622a704143bb2b4f /Emby.Server.Implementations/Library/MediaSourceManager.cs | |
| parent | f38970cbd32c845d1740828450aac8de16fec788 (diff) | |
Use streams instead of strings
Diffstat (limited to 'Emby.Server.Implementations/Library/MediaSourceManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/MediaSourceManager.cs | 4 |
1 files changed, 2 insertions, 2 deletions
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"); } |
