mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-30 12:44:48 +03:00
Use UTF8 encoding and async correctly
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -341,7 +342,7 @@ namespace Emby.Server.Implementations.Channels
|
||||
|
||||
try
|
||||
{
|
||||
var jsonString = File.ReadAllText(path);
|
||||
var jsonString = File.ReadAllText(path, Encoding.UTF8);
|
||||
return JsonSerializer.Deserialize<List<MediaSourceInfo>>(jsonString, _jsonOptions)
|
||||
?? new List<MediaSourceInfo>();
|
||||
}
|
||||
@@ -1180,11 +1181,11 @@ namespace Emby.Server.Implementations.Channels
|
||||
{
|
||||
if (enableMediaProbe && !info.IsLiveStream && item.HasPathProtocol)
|
||||
{
|
||||
await SaveMediaSources(item, new List<MediaSourceInfo>());
|
||||
await SaveMediaSources(item, new List<MediaSourceInfo>()).ConfigureAwait(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
await SaveMediaSources(item, info.MediaSources);
|
||||
await SaveMediaSources(item, info.MediaSources).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user