diff options
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;
+ });
}
}
}
|
