diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-19 16:38:47 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-19 16:38:47 -0400 |
| commit | 5b7063e7c612f9447372f52ea337f37c0f0fb11d (patch) | |
| tree | 0d5a0d04cc4572d1ad63611b76ff81860573d61b /MediaBrowser.Api/HttpHandlers/PluginsHandler.cs | |
| parent | a129c93c42ee02aa7ecdb9227552d18eac034b98 (diff) | |
| parent | 937d27ae9d6aa571ab9327f138bfba1b84c158db (diff) | |
Merge
Diffstat (limited to 'MediaBrowser.Api/HttpHandlers/PluginsHandler.cs')
| -rw-r--r-- | MediaBrowser.Api/HttpHandlers/PluginsHandler.cs | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs b/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs index c3c1b4049..f451832dd 100644 --- a/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs +++ b/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs @@ -1,5 +1,6 @@ using System.Collections.Generic;
using System.Linq;
+using System.Threading.Tasks;
using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
using MediaBrowser.Model.DTO;
@@ -11,26 +12,29 @@ namespace MediaBrowser.Api.HttpHandlers /// </summary>
public class PluginsHandler : BaseJsonHandler<IEnumerable<PluginInfo>>
{
- protected override IEnumerable<PluginInfo> GetObjectToSerialize()
+ protected override Task<IEnumerable<PluginInfo>> GetObjectToSerialize()
{
- var plugins = Kernel.Instance.Plugins.Select(p =>
+ return Task.Run(() =>
{
- return new PluginInfo()
+ var plugins = Kernel.Instance.Plugins.Select(p =>
{
- Path = p.Path,
- Name = p.Name,
- Enabled = p.Enabled,
- DownloadToUI = p.DownloadToUI,
- Version = p.Version
- };
- });
+ return new PluginInfo()
+ {
+ Path = p.Path,
+ Name = p.Name,
+ Enabled = p.Enabled,
+ DownloadToUI = p.DownloadToUI,
+ Version = p.Version
+ };
+ });
- if (QueryString["uionly"] == "1")
- {
- plugins = plugins.Where(p => p.DownloadToUI);
- }
+ if (QueryString["uionly"] == "1")
+ {
+ plugins = plugins.Where(p => p.DownloadToUI);
+ }
- return plugins;
+ return plugins;
+ });
}
}
}
|
