diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-09-03 14:15:07 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-09-03 14:15:07 -0400 |
| commit | 4500f1d11bac97d553af74a5053aa42ac00f6ff7 (patch) | |
| tree | 49177d935c0a99095bfd12366548de65cfd40d43 | |
| parent | 74945388297a950b51bcace446858ba07203762c (diff) | |
Added an api method to download the list of installed plugins from the server
| -rw-r--r-- | MediaBrowser.Api/HttpHandlers/PluginsHandler.cs | 7 | ||||
| -rw-r--r-- | MediaBrowser.ApiInteraction/ApiClient.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Model/DTO/PluginInfo.cs | 2 |
3 files changed, 15 insertions, 7 deletions
diff --git a/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs b/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs index ab2efc949..acfa5ebeb 100644 --- a/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs +++ b/MediaBrowser.Api/HttpHandlers/PluginsHandler.cs @@ -21,15 +21,10 @@ namespace MediaBrowser.Api.HttpHandlers Name = p.Name,
Enabled = p.Enabled,
DownloadToUI = p.DownloadToUI,
- Version = p.Version
+ Version = p.Version.ToString()
};
});
- if (QueryString["uionly"] == "1")
- {
- plugins = plugins.Where(p => p.DownloadToUI);
- }
-
return Task.FromResult<IEnumerable<PluginInfo>>(plugins);
}
}
diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs index 3de40f6a8..621c700cf 100644 --- a/MediaBrowser.ApiInteraction/ApiClient.cs +++ b/MediaBrowser.ApiInteraction/ApiClient.cs @@ -567,6 +567,19 @@ namespace MediaBrowser.ApiInteraction }
/// <summary>
+ /// Gets a list of plugins installed on the server
+ /// </summary>
+ public async Task<PluginInfo[]> GetInstalledPlugins()
+ {
+ string url = ApiUrl + "/plugins";
+
+ using (Stream stream = await GetSerializedStreamAsync(url).ConfigureAwait(false))
+ {
+ return DeserializeFromStream<PluginInfo[]>(stream);
+ }
+ }
+
+ /// <summary>
/// Gets weather information for the default location as set in configuration
/// </summary>
public async Task<ServerConfiguration> GetServerConfigurationAsync()
diff --git a/MediaBrowser.Model/DTO/PluginInfo.cs b/MediaBrowser.Model/DTO/PluginInfo.cs index 4819296f4..7ddadbc93 100644 --- a/MediaBrowser.Model/DTO/PluginInfo.cs +++ b/MediaBrowser.Model/DTO/PluginInfo.cs @@ -22,6 +22,6 @@ namespace MediaBrowser.Model.DTO public DateTime ConfigurationDateLastModified { get; set; }
[ProtoMember(5)]
- public Version Version { get; set; }
+ public string Version { get; set; }
}
}
|
