diff options
| author | Greenback <jimcartlidge@yahoo.co.uk> | 2020-12-15 16:37:11 +0000 |
|---|---|---|
| committer | Greenback <jimcartlidge@yahoo.co.uk> | 2020-12-15 16:37:11 +0000 |
| commit | eb2439f23b05a9b92a81ee96c7801d10ccfbb25d (patch) | |
| tree | ae30daafcfea9388bd4a9828ce130af5e5191238 /Emby.Server.Implementations/Updates | |
| parent | c761cbff0e2d8bbf6b348db09c664760c4ccd1eb (diff) | |
Changes as recommended.
Diffstat (limited to 'Emby.Server.Implementations/Updates')
| -rw-r--r-- | Emby.Server.Implementations/Updates/InstallationManager.cs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs index b7bbbd348..fc80bdd75 100644 --- a/Emby.Server.Implementations/Updates/InstallationManager.cs +++ b/Emby.Server.Implementations/Updates/InstallationManager.cs @@ -8,7 +8,6 @@ using System.Linq; using System.Net.Http; using System.Net.Http.Json; using System.Security.Cryptography; -using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -106,18 +105,8 @@ namespace Emby.Server.Implementations.Updates try { List<PackageInfo>? packages; - var uri = new Uri(manifest); - if (uri.Scheme.StartsWith("http", StringComparison.OrdinalIgnoreCase)) - { - packages = await _httpClientFactory.CreateClient(NamedClient.Default) - .GetFromJsonAsync<List<PackageInfo>>(uri, _jsonSerializerOptions, cancellationToken).ConfigureAwait(false); - } - else - { - // Local Packages - var data = File.ReadAllText(manifest, Encoding.UTF8); - packages = JsonSerializer.Deserialize<List<PackageInfo>>(data, _jsonSerializerOptions); - } + packages = await _httpClientFactory.CreateClient(NamedClient.Default) + .GetFromJsonAsync<List<PackageInfo>>(new Uri(manifest), _jsonSerializerOptions, cancellationToken).ConfigureAwait(false); if (packages == null) { |
