2012-07-24 16:54:34 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
2012-08-19 22:38:31 +02:00
|
|
|
|
using System.Threading.Tasks;
|
2012-08-15 15:20:29 +02:00
|
|
|
|
using MediaBrowser.Common.Net.Handlers;
|
2012-07-24 16:54:34 +02:00
|
|
|
|
using MediaBrowser.Controller;
|
2012-08-17 15:16:50 +02:00
|
|
|
|
using MediaBrowser.Model.Plugins;
|
2012-07-24 16:54:34 +02:00
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Api.HttpHandlers
|
|
|
|
|
{
|
2012-08-17 15:16:50 +02:00
|
|
|
|
public class PluginConfigurationHandler : BaseJsonHandler<BasePluginConfiguration>
|
2012-07-24 16:54:34 +02:00
|
|
|
|
{
|
2012-08-19 22:38:31 +02:00
|
|
|
|
protected override Task<BasePluginConfiguration> GetObjectToSerialize()
|
2012-07-24 16:54:34 +02:00
|
|
|
|
{
|
2012-08-19 22:38:31 +02:00
|
|
|
|
return Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
string pluginName = QueryString["name"];
|
2012-07-24 16:54:34 +02:00
|
|
|
|
|
2012-08-19 22:38:31 +02:00
|
|
|
|
return Kernel.Instance.Plugins.First(p => p.Name.Equals(pluginName, StringComparison.OrdinalIgnoreCase)).Configuration;
|
|
|
|
|
});
|
2012-07-24 16:54:34 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|