aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/LiveStreamHelper.cs
diff options
context:
space:
mode:
authorClaus Vium <cvium@users.noreply.github.com>2021-09-06 13:55:34 +0200
committerGitHub <noreply@github.com>2021-09-06 13:55:34 +0200
commit74fef6c05bd61a8d1a3eba421c687619e7af19e1 (patch)
treee160b79312891a69af5ce3301268760772e594f7 /Emby.Server.Implementations/Library/LiveStreamHelper.cs
parentbf0a0c8b62aeb6eac6737461aac86c2e5a896f6d (diff)
parente3dac4fda2033801085eb7086a3a534c473a00a0 (diff)
Merge pull request #6177 from Bond-009/async
Use async FileStreams where it makes sense
Diffstat (limited to 'Emby.Server.Implementations/Library/LiveStreamHelper.cs')
-rw-r--r--Emby.Server.Implementations/Library/LiveStreamHelper.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Library/LiveStreamHelper.cs b/Emby.Server.Implementations/Library/LiveStreamHelper.cs
index 806269182..16b45161f 100644
--- a/Emby.Server.Implementations/Library/LiveStreamHelper.cs
+++ b/Emby.Server.Implementations/Library/LiveStreamHelper.cs
@@ -17,6 +17,7 @@ using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
+using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo;
using Microsoft.Extensions.Logging;
@@ -49,7 +50,7 @@ namespace Emby.Server.Implementations.Library
{
try
{
- await using FileStream jsonStream = File.OpenRead(cacheFilePath);
+ await using FileStream jsonStream = AsyncFile.OpenRead(cacheFilePath);
mediaInfo = await JsonSerializer.DeserializeAsync<MediaInfo>(jsonStream, _jsonOptions, cancellationToken).ConfigureAwait(false);
// _logger.LogDebug("Found cached media info");
@@ -86,7 +87,7 @@ namespace Emby.Server.Implementations.Library
if (cacheFilePath != null)
{
Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath));
- await using FileStream createStream = File.OpenWrite(cacheFilePath);
+ await using FileStream createStream = AsyncFile.OpenWrite(cacheFilePath);
await JsonSerializer.SerializeAsync(createStream, mediaInfo, _jsonOptions, cancellationToken).ConfigureAwait(false);
// _logger.LogDebug("Saved media info to {0}", cacheFilePath);