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

22 lines
739 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 name = QueryString["assemblyfilename"];
BasePluginConfiguration config = Kernel.Instance.Plugins.First(p => p.AssemblyFileName.Equals(name, StringComparison.OrdinalIgnoreCase)).Configuration;
return Task.FromResult<BasePluginConfiguration>(config);
}
}
}