jellyfin-server/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs
LukePulverenti Luke Pulverenti luke pulverenti fc735e9187 Tweaked plugin downloading a bit
2012-09-03 17:56:30 -04:00

34 lines
1.1 KiB
C#

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
{
/// <summary>
/// Provides information about installed plugins
/// </summary>
public class PluginsHandler : BaseSerializationHandler<IEnumerable<PluginInfo>>
{
protected override Task<IEnumerable<PluginInfo>> GetObjectToSerialize()
{
var plugins = Kernel.Instance.Plugins.Select(p =>
{
return new PluginInfo()
{
Name = p.Name,
Enabled = p.Enabled,
DownloadToUI = p.DownloadToUI,
Version = p.Version.ToString(),
AssemblyFileName = p.AssemblyFileName,
ConfigurationDateLastModified = p.ConfigurationDateLastModified
};
});
return Task.FromResult<IEnumerable<PluginInfo>>(plugins);
}
}
}