Corrections as recommended.

pull/4709/head
Greenback 4 years ago
parent ebbb57efc3
commit 1ed25ebd9a

@ -92,7 +92,7 @@ namespace Emby.Server.Implementations.Updates
_httpClientFactory = httpClientFactory; _httpClientFactory = httpClientFactory;
_config = config; _config = config;
_zipClient = zipClient; _zipClient = zipClient;
_jsonSerializerOptions = JsonDefaults.GetCamelCaseOptions(); _jsonSerializerOptions = JsonDefaults.GetOptions();
_pluginManager = pluginManager; _pluginManager = pluginManager;
} }
@ -104,8 +104,7 @@ namespace Emby.Server.Implementations.Updates
{ {
try try
{ {
List<PackageInfo>? packages; List<PackageInfo>? packages = await _httpClientFactory.CreateClient(NamedClient.Default)
packages = await _httpClientFactory.CreateClient(NamedClient.Default)
.GetFromJsonAsync<List<PackageInfo>>(new Uri(manifest), _jsonSerializerOptions, cancellationToken).ConfigureAwait(false); .GetFromJsonAsync<List<PackageInfo>>(new Uri(manifest), _jsonSerializerOptions, cancellationToken).ConfigureAwait(false);
if (packages == null) if (packages == null)

@ -217,8 +217,13 @@ namespace Jellyfin.Api.Controllers
plugin = plugins.OrderBy(p => p.Manifest.Status).FirstOrDefault(); plugin = plugins.OrderBy(p => p.Manifest.Status).FirstOrDefault();
} }
_installationManager.UninstallPlugin(plugin!); if (plugin != null)
return NoContent(); {
_installationManager.UninstallPlugin(plugin!);
return NoContent();
}
return NotFound();
} }
/// <summary> /// <summary>
@ -303,10 +308,7 @@ namespace Jellyfin.Api.Controllers
|| plugin.Manifest.ImageUrl == null || plugin.Manifest.ImageUrl == null
|| !System.IO.File.Exists(imgPath)) || !System.IO.File.Exists(imgPath))
{ {
// Use a blank image. return NotFound();
var type = GetType();
var stream = type.Assembly.GetManifestResourceStream(type.Namespace + ".Plugins.blank.png");
return File(stream, "image/png");
} }
imgPath = Path.Combine(plugin.Path, plugin.Manifest.ImageUrl); imgPath = Path.Combine(plugin.Path, plugin.Manifest.ImageUrl);
@ -333,7 +335,7 @@ namespace Jellyfin.Api.Controllers
if (plugin != null) if (plugin != null)
{ {
return Ok(plugin.Manifest); return plugin.Manifest;
} }
return NotFound(); return NotFound();

Loading…
Cancel
Save