using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
using MediaBrowser.Model.DTO;
namespace MediaBrowser.Api.HttpHandlers
{
///
/// Provides information about installed plugins
///
public class PluginsHandler : BaseSerializationHandler>
{
protected override Task> GetObjectToSerialize()
{
var plugins = Kernel.Instance.Plugins.Select(p =>
{
return new PluginInfo()
{
Name = p.Name,
Enabled = p.Enabled,
DownloadToUI = p.DownloadToUI,
Version = p.Version.ToString()
};
});
return Task.FromResult>(plugins);
}
}
}