diff options
| author | Greenback <jimcartlidge@yahoo.co.uk> | 2020-12-16 22:36:25 +0000 |
|---|---|---|
| committer | Greenback <jimcartlidge@yahoo.co.uk> | 2020-12-16 22:36:25 +0000 |
| commit | 1ed25ebd9a11f3fc1838e347a34621dcde0b7bd5 (patch) | |
| tree | 37da3cb08268d7c61792afa123c9974eec57b9e4 /Jellyfin.Api/Controllers | |
| parent | ebbb57efc3274663b515b4accc52f4a4e9920e77 (diff) | |
Corrections as recommended.
Diffstat (limited to 'Jellyfin.Api/Controllers')
| -rw-r--r-- | Jellyfin.Api/Controllers/PluginsController.cs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Jellyfin.Api/Controllers/PluginsController.cs b/Jellyfin.Api/Controllers/PluginsController.cs index 4f65e18e1..6db74571c 100644 --- a/Jellyfin.Api/Controllers/PluginsController.cs +++ b/Jellyfin.Api/Controllers/PluginsController.cs @@ -217,8 +217,13 @@ namespace Jellyfin.Api.Controllers plugin = plugins.OrderBy(p => p.Manifest.Status).FirstOrDefault(); } - _installationManager.UninstallPlugin(plugin!); - return NoContent(); + if (plugin != null) + { + _installationManager.UninstallPlugin(plugin!); + return NoContent(); + } + + return NotFound(); } /// <summary> @@ -303,10 +308,7 @@ namespace Jellyfin.Api.Controllers || plugin.Manifest.ImageUrl == null || !System.IO.File.Exists(imgPath)) { - // Use a blank image. - var type = GetType(); - var stream = type.Assembly.GetManifestResourceStream(type.Namespace + ".Plugins.blank.png"); - return File(stream, "image/png"); + return NotFound(); } imgPath = Path.Combine(plugin.Path, plugin.Manifest.ImageUrl); @@ -333,7 +335,7 @@ namespace Jellyfin.Api.Controllers if (plugin != null) { - return Ok(plugin.Manifest); + return plugin.Manifest; } return NotFound(); |
