diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-08-24 16:37:34 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-08-24 16:37:34 -0400 |
| commit | 41fc1f87f57374f8bc8ce1ca1ac3c62f789a40e6 (patch) | |
| tree | 79d09a050f0c13a46eacdc35a63207164276e5ea /MediaBrowser.Common.Implementations/Updates/InstallationManager.cs | |
| parent | 92ff7414ae25ccd7c8ce5a09154b190094293162 (diff) | |
update plugin catalog
Diffstat (limited to 'MediaBrowser.Common.Implementations/Updates/InstallationManager.cs')
| -rw-r--r-- | MediaBrowser.Common.Implementations/Updates/InstallationManager.cs | 19 |
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); } } |
