update plugin catalog
This commit is contained in:
parent
92ff7414ae
commit
41fc1f87f5
|
@ -190,7 +190,7 @@ namespace MediaBrowser.Api
|
||||||
/// <returns>System.Object.</returns>
|
/// <returns>System.Object.</returns>
|
||||||
public async Task<object> Get(GetPackages request)
|
public async Task<object> Get(GetPackages request)
|
||||||
{
|
{
|
||||||
var packages = await _installationManager.GetAvailablePackages(CancellationToken.None, request.PackageType, _appHost.ApplicationVersion).ConfigureAwait(false);
|
var packages = await _installationManager.GetAvailablePackages(CancellationToken.None, false, request.PackageType, _appHost.ApplicationVersion).ConfigureAwait(false);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(request.TargetSystems))
|
if (!string.IsNullOrEmpty(request.TargetSystems))
|
||||||
{
|
{
|
||||||
|
|
|
@ -149,10 +149,12 @@ namespace MediaBrowser.Common.Implementations.Updates
|
||||||
/// Gets all available packages.
|
/// Gets all available packages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <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="packageType">Type of the package.</param>
|
||||||
/// <param name="applicationVersion">The application version.</param>
|
/// <param name="applicationVersion">The application version.</param>
|
||||||
/// <returns>Task{List{PackageInfo}}.</returns>
|
/// <returns>Task{List{PackageInfo}}.</returns>
|
||||||
public async Task<IEnumerable<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken,
|
public async Task<IEnumerable<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken,
|
||||||
|
bool withRegistration = true,
|
||||||
PackageType? packageType = null,
|
PackageType? packageType = null,
|
||||||
Version applicationVersion = null)
|
Version applicationVersion = null)
|
||||||
{
|
{
|
||||||
|
@ -163,13 +165,22 @@ namespace MediaBrowser.Common.Implementations.Updates
|
||||||
{ "systemid", _applicationHost.SystemId }
|
{ "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);
|
return FilterPackages(packages, packageType, applicationVersion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var packages = await GetAvailablePackagesWithoutRegistrationInfo(cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
|
return FilterPackages(packages.ToList(), packageType, applicationVersion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,12 @@ namespace MediaBrowser.Common.Updates
|
||||||
/// Gets all available packages.
|
/// Gets all available packages.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <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="packageType">Type of the package.</param>
|
||||||
/// <param name="applicationVersion">The application version.</param>
|
/// <param name="applicationVersion">The application version.</param>
|
||||||
/// <returns>Task{List{PackageInfo}}.</returns>
|
/// <returns>Task{List{PackageInfo}}.</returns>
|
||||||
Task<IEnumerable<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken,
|
Task<IEnumerable<PackageInfo>> GetAvailablePackages(CancellationToken cancellationToken,
|
||||||
|
bool withRegistration = true,
|
||||||
PackageType? packageType = null,
|
PackageType? packageType = null,
|
||||||
Version applicationVersion = null);
|
Version applicationVersion = null);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
//[assembly: AssemblyVersion("3.0.*")]
|
[assembly: AssemblyVersion("3.0.*")]
|
||||||
[assembly: AssemblyVersion("3.0.5713.1")]
|
//[assembly: AssemblyVersion("3.0.5713.1")]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user