aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/HttpHandlers/PluginsHandler.cs')
-rw-r--r--MediaBrowser.Api/HttpHandlers/PluginsHandler.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs b/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs
new file mode 100644
index 000000000..a558da163
--- /dev/null
+++ b/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs
@@ -0,0 +1,37 @@
+using System.Linq;
+using MediaBrowser.Controller;
+using MediaBrowser.Model.Plugins;
+
+namespace MediaBrowser.Api.HttpHandlers
+{
+ /// <summary>
+ /// Provides information about installed plugins
+ /// </summary>
+ public class PluginsHandler : JsonHandler
+ {
+ protected override object ObjectToSerialize
+ {
+ get
+ {
+ var plugins = Kernel.Instance.PluginController.Plugins.Select(p =>
+ {
+ return new PluginInfo()
+ {
+ 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;
+ }
+ }
+ }
+}