aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-09-02 11:50:00 -0400
committerLuke <luke.pulverenti@gmail.com>2015-09-02 11:50:00 -0400
commitf868dd81e856488280978006cbb67afc2677049d (patch)
tree616ba8ae846efe9ec889abeb12f6b2702c6b8592 /MediaBrowser.Common.Implementations/Updates/InstallationManager.cs
parentaf89446c20fb302087b82c18c28da92076dbc5ac (diff)
parente6d5901408ba7d8e344a27ea1f3b0046c40e56c1 (diff)
Merge pull request #1164 from MediaBrowser/dev
3.0.5724.1
Diffstat (limited to 'MediaBrowser.Common.Implementations/Updates/InstallationManager.cs')
-rw-r--r--MediaBrowser.Common.Implementations/Updates/InstallationManager.cs19
1 files changed, 15 insertions, 4 deletions
diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs
index 23785083b..5f205d69e 100644
--- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs
+++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs
@@ -149,10 +149,12 @@ namespace MediaBrowser.Common.Implementations.Updates
/// Gets all available packages.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
+ /// <param name="withRegistration">if set to <c>true</c> [with registration].</param>
/// <param name="packageType">Type of the package.</param>
/// <param name="applicationVersion">The application version.</param>
/// <returns>Task{List{PackageInfo}}.</returns>
public async Task<IEnumerable<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken,
+ bool withRegistration = true,
PackageType? packageType = null,
Version applicationVersion = null)
{
@@ -163,13 +165,22 @@ namespace MediaBrowser.Common.Implementations.Updates
{ "systemid", _applicationHost.SystemId }
};
- using (var json = await _httpClient.Post(MbAdmin.HttpsUrl + "service/package/retrieveall", data, cancellationToken).ConfigureAwait(false))
+ if (withRegistration)
{
- cancellationToken.ThrowIfCancellationRequested();
+ using (var json = await _httpClient.Post(MbAdmin.HttpsUrl + "service/package/retrieveall", data, cancellationToken).ConfigureAwait(false))
+ {
+ cancellationToken.ThrowIfCancellationRequested();
- var packages = _jsonSerializer.DeserializeFromStream<List<PackageInfo>>(json).ToList();
+ var packages = _jsonSerializer.DeserializeFromStream<List<PackageInfo>>(json).ToList();
+
+ return FilterPackages(packages, packageType, applicationVersion);
+ }
+ }
+ else
+ {
+ var packages = await GetAvailablePackagesWithoutRegistrationInfo(cancellationToken).ConfigureAwait(false);
- return FilterPackages(packages, packageType, applicationVersion);
+ return FilterPackages(packages.ToList(), packageType, applicationVersion);
}
}