diff options
Diffstat (limited to 'MediaBrowser.Api/HttpHandlers/PluginsHandler.cs')
| -rw-r--r-- | MediaBrowser.Api/HttpHandlers/PluginsHandler.cs | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs b/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs index 63797026d..a44e12692 100644 --- a/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs +++ b/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs @@ -1,4 +1,5 @@ using System.Linq;
+using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
using MediaBrowser.Model.Plugins;
@@ -7,31 +8,28 @@ namespace MediaBrowser.Api.HttpHandlers /// <summary>
/// Provides information about installed plugins
/// </summary>
- public class PluginsHandler : JsonHandler
+ public class PluginsHandler : BaseJsonHandler
{
- protected override object ObjectToSerialize
+ protected override object GetObjectToSerialize()
{
- get
+ var plugins = Kernel.Instance.Plugins.Select(p =>
{
- var plugins = Kernel.Instance.Plugins.Select(p =>
+ return new PluginInfo()
{
- return new PluginInfo()
- {
- Path = p.Path,
- Name = p.Name,
- Enabled = p.Enabled,
- DownloadToUI = p.DownloadToUI,
- Version = p.Version
- };
- });
+ Path = p.Path,
+ Name = p.Name,
+ Enabled = p.Enabled,
+ DownloadToUI = p.DownloadToUI,
+ Version = p.Version
+ };
+ });
- if (QueryString["uionly"] == "1")
- {
- plugins = plugins.Where(p => p.DownloadToUI);
- }
-
- return plugins;
+ if (QueryString["uionly"] == "1")
+ {
+ plugins = plugins.Where(p => p.DownloadToUI);
}
+
+ return plugins;
}
}
}
|
