mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-15 23:02:18 +01:00
Add missing FileStreams
This commit is contained in:
@@ -341,7 +341,8 @@ namespace Emby.Server.Implementations.Channels
|
||||
try
|
||||
{
|
||||
using FileStream jsonStream = File.OpenRead(path);
|
||||
return JsonSerializer.DeserializeAsync<List<MediaSourceInfo>>(jsonStream, JsonDefaults.GetOptions()).GetAwaiter().GetResult();
|
||||
return JsonSerializer.DeserializeAsync<List<MediaSourceInfo>>(jsonStream, JsonDefaults.GetOptions()).GetAwaiter().GetResult()
|
||||
?? new List<MediaSourceInfo>();
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -810,8 +811,8 @@ namespace Emby.Server.Implementations.Channels
|
||||
{
|
||||
if (_fileSystem.GetLastWriteTimeUtc(cachePath).Add(cacheLength) > DateTime.UtcNow)
|
||||
{
|
||||
var jsonString = await File.ReadAllTextAsync(cachePath, cancellationToken);
|
||||
var cachedResult = JsonSerializer.Deserialize<ChannelItemResult>(jsonString);
|
||||
await using FileStream jsonStream = File.OpenRead(cachePath);
|
||||
var cachedResult = await JsonSerializer.DeserializeAsync<ChannelItemResult>(jsonStream, JsonDefaults.GetOptions(), cancellationToken).ConfigureAwait(false);
|
||||
if (cachedResult != null)
|
||||
{
|
||||
return null;
|
||||
@@ -833,8 +834,8 @@ namespace Emby.Server.Implementations.Channels
|
||||
{
|
||||
if (_fileSystem.GetLastWriteTimeUtc(cachePath).Add(cacheLength) > DateTime.UtcNow)
|
||||
{
|
||||
var jsonString = await File.ReadAllTextAsync(cachePath, cancellationToken);
|
||||
var cachedResult = JsonSerializer.Deserialize<ChannelItemResult>(jsonString);
|
||||
await using FileStream jsonStream = File.OpenRead(cachePath);
|
||||
var cachedResult = await JsonSerializer.DeserializeAsync<ChannelItemResult>(jsonStream, JsonDefaults.GetOptions(), cancellationToken).ConfigureAwait(false);
|
||||
if (cachedResult != null)
|
||||
{
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user