2012-07-24 14:54:34 +00:00
|
|
|
|
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
|
|
|
|
|
{
|
2012-07-26 02:33:11 +00:00
|
|
|
|
var plugins = Kernel.Instance.Plugins.Select(p =>
|
2012-07-24 14:54:34 +00:00
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|