22 lines
727 B
C#
22 lines
727 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using MediaBrowser.Common.Net.Handlers;
|
|
using MediaBrowser.Controller;
|
|
using MediaBrowser.Model.Plugins;
|
|
|
|
namespace MediaBrowser.Api.HttpHandlers
|
|
{
|
|
public class PluginConfigurationHandler : BaseSerializationHandler<BasePluginConfiguration>
|
|
{
|
|
protected override Task<BasePluginConfiguration> GetObjectToSerialize()
|
|
{
|
|
string pluginName = QueryString["name"];
|
|
|
|
BasePluginConfiguration config = Kernel.Instance.Plugins.First(p => p.Name.Equals(pluginName, StringComparison.OrdinalIgnoreCase)).Configuration;
|
|
|
|
return Task.FromResult<BasePluginConfiguration>(config);
|
|
}
|
|
}
|
|
}
|