diff options
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 3 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Emby.Server.Implementations.csproj | 7 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Plugins/Active.png | bin | 1422 -> 0 bytes | |||
| -rw-r--r-- | Emby.Server.Implementations/Plugins/Disabled.png | bin | 1790 -> 0 bytes | |||
| -rw-r--r-- | Emby.Server.Implementations/Plugins/Malfunction.png | bin | 2091 -> 0 bytes | |||
| -rw-r--r-- | Emby.Server.Implementations/Plugins/NotSupported.png | bin | 2046 -> 0 bytes | |||
| -rw-r--r-- | Emby.Server.Implementations/Plugins/PluginManager.cs | 3 | ||||
| -rw-r--r-- | Emby.Server.Implementations/Plugins/RestartRequired.png | bin | 1996 -> 0 bytes | |||
| -rw-r--r-- | Emby.Server.Implementations/Plugins/Superceded.png | bin | 2136 -> 0 bytes | |||
| -rw-r--r-- | Emby.Server.Implementations/Plugins/blank.png | bin | 120 -> 0 bytes | |||
| -rw-r--r-- | Jellyfin.Api/Controllers/PluginsController.cs | 60 |
11 files changed, 32 insertions, 41 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 404e28bdc..17cccdaf9 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -393,8 +393,7 @@ namespace Emby.Server.Implementations if (_creatingInstances.IndexOf(type) != -1) { - Logger.LogError("DI Loop detected."); - Logger.LogError("Attempted creation of {Type}", type.FullName); + Logger.LogError("DI Loop detected in the attempted creation of {Type}", type.FullName); foreach (var entry in _creatingInstances) { Logger.LogError("Called from: {stack}", entry.FullName); diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index 7e0be7899..0c94f937c 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -73,12 +73,5 @@ <EmbeddedResource Include="Localization\countries.json" /> <EmbeddedResource Include="Localization\Core\*.json" /> <EmbeddedResource Include="Localization\Ratings\*.csv" /> - <EmbeddedResource Include="Plugins\blank.png" /> - <EmbeddedResource Include="Plugins\Superceded.png" /> - <EmbeddedResource Include="Plugins\Disabled.png" /> - <EmbeddedResource Include="Plugins\NotSupported.png" /> - <EmbeddedResource Include="Plugins\Malfunction.png" /> - <EmbeddedResource Include="Plugins\RestartRequired.png" /> - <EmbeddedResource Include="Plugins\Active.png" /> </ItemGroup> </Project> diff --git a/Emby.Server.Implementations/Plugins/Active.png b/Emby.Server.Implementations/Plugins/Active.png Binary files differdeleted file mode 100644 index 3722ee520..000000000 --- a/Emby.Server.Implementations/Plugins/Active.png +++ /dev/null diff --git a/Emby.Server.Implementations/Plugins/Disabled.png b/Emby.Server.Implementations/Plugins/Disabled.png Binary files differdeleted file mode 100644 index eeb8ffefc..000000000 --- a/Emby.Server.Implementations/Plugins/Disabled.png +++ /dev/null diff --git a/Emby.Server.Implementations/Plugins/Malfunction.png b/Emby.Server.Implementations/Plugins/Malfunction.png Binary files differdeleted file mode 100644 index d4726150e..000000000 --- a/Emby.Server.Implementations/Plugins/Malfunction.png +++ /dev/null diff --git a/Emby.Server.Implementations/Plugins/NotSupported.png b/Emby.Server.Implementations/Plugins/NotSupported.png Binary files differdeleted file mode 100644 index a13c1f7c1..000000000 --- a/Emby.Server.Implementations/Plugins/NotSupported.png +++ /dev/null diff --git a/Emby.Server.Implementations/Plugins/PluginManager.cs b/Emby.Server.Implementations/Plugins/PluginManager.cs index 07b729748..cf25ccf48 100644 --- a/Emby.Server.Implementations/Plugins/PluginManager.cs +++ b/Emby.Server.Implementations/Plugins/PluginManager.cs @@ -1,7 +1,6 @@ #nullable enable using System; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; using System.Reflection; @@ -23,8 +22,6 @@ namespace Emby.Server.Implementations /// </summary> public class PluginManager : IPluginManager { - private const int OffsetFromTopRightCorner = 38; - private readonly string _pluginsPath; private readonly Version _appVersion; private readonly JsonSerializerOptions _jsonOptions; diff --git a/Emby.Server.Implementations/Plugins/RestartRequired.png b/Emby.Server.Implementations/Plugins/RestartRequired.png Binary files differdeleted file mode 100644 index 65fd102a2..000000000 --- a/Emby.Server.Implementations/Plugins/RestartRequired.png +++ /dev/null diff --git a/Emby.Server.Implementations/Plugins/Superceded.png b/Emby.Server.Implementations/Plugins/Superceded.png Binary files differdeleted file mode 100644 index 251e70535..000000000 --- a/Emby.Server.Implementations/Plugins/Superceded.png +++ /dev/null diff --git a/Emby.Server.Implementations/Plugins/blank.png b/Emby.Server.Implementations/Plugins/blank.png Binary files differdeleted file mode 100644 index f81ae3243..000000000 --- a/Emby.Server.Implementations/Plugins/blank.png +++ /dev/null diff --git a/Jellyfin.Api/Controllers/PluginsController.cs b/Jellyfin.Api/Controllers/PluginsController.cs index 36e37b7ad..c84dc6a13 100644 --- a/Jellyfin.Api/Controllers/PluginsController.cs +++ b/Jellyfin.Api/Controllers/PluginsController.cs @@ -167,7 +167,7 @@ namespace Jellyfin.Api.Controllers } /// <summary> - /// Uninstalls a plugin. + /// Uninstalls a plugin by version. /// </summary> /// <param name="pluginId">Plugin id.</param> /// <param name="version">Plugin version.</param> @@ -178,7 +178,7 @@ namespace Jellyfin.Api.Controllers [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] - public ActionResult UninstallPlugin([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version) + public ActionResult UninstallPluginByVersion([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version) { if (!_pluginManager.TryGetPlugin(pluginId, version, out var plugin)) { @@ -190,6 +190,35 @@ namespace Jellyfin.Api.Controllers } /// <summary> + /// Uninstalls a plugin. + /// </summary> + /// <param name="pluginId">Plugin id.</param> + /// <response code="204">Plugin uninstalled.</response> + /// <response code="404">Plugin not found.</response> + /// <returns>An <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if the file could not be found.</returns> + [HttpDelete("{pluginId}")] + [Authorize(Policy = Policies.RequiresElevation)] + [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + [Obsolete("Please use the UninstallByVersion API.")] + public ActionResult UninstallPlugin([FromRoute, Required] Guid pluginId) + { + // If no version is given, return the current instance. + var plugins = _pluginManager.Plugins.Where(p => p.Id.Equals(pluginId)); + + // Select the un-instanced one first. + var plugin = plugins.FirstOrDefault(p => p.Instance != null); + if (plugin == null) + { + // Then by the status. + plugin = plugins.OrderBy(p => p.Manifest.Status).FirstOrDefault(); + } + + _installationManager.UninstallPlugin(plugin!); + return NoContent(); + } + + /// <summary> /// Gets plugin configuration. /// </summary> /// <param name="pluginId">Plugin id.</param> @@ -282,33 +311,6 @@ namespace Jellyfin.Api.Controllers } /// <summary> - /// Gets a plugin's status image. - /// </summary> - /// <param name="pluginId">Plugin id.</param> - /// <param name="version">Plugin version.</param> - /// <response code="200">Plugin image returned.</response> - /// <returns>Plugin's image.</returns> - [HttpGet("{pluginId}/{version}/StatusImage")] - [ProducesResponseType(StatusCodes.Status200OK)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - [ProducesImageFile] - [AllowAnonymous] - public ActionResult GetPluginStatusImage([FromRoute, Required] Guid pluginId, [FromRoute, Required] Version version) - { - if (!_pluginManager.TryGetPlugin(pluginId, version, out var plugin)) - { - return NotFound(); - } - - // Icons from http://www.fatcow.com/free-icons - var status = plugin!.Manifest.Status; - - var type = _pluginManager.GetType(); - var stream = type.Assembly.GetManifestResourceStream($"{type.Namespace}.Plugins.{status}.png"); - return File(stream, "image/png"); - } - - /// <summary> /// Gets a plugin's manifest. /// </summary> /// <param name="pluginId">Plugin id.</param> |
