The Free Software Media System - Server Backend & API
updated nuget
Luke Pulverenti3733ebd21e0a
diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.csindex b3b63da151..cc4324e989 100644--- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs+++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs@@ -156,17 +156,13 @@ namespace MediaBrowser.Common.Implementations.Updates}private Tuple<List<PackageInfo>, DateTime> _lastPackageListResult;-+/// <summary>/// Gets all available packages./// </summary>/// <param name="cancellationToken">The cancellation token.</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>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken,- PackageType? packageType = null,- Version applicationVersion = null)+ public async Task<IEnumerable<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken){if (_lastPackageListResult != null){@@ -187,10 +183,26 @@ namespace MediaBrowser.Common.Implementations.Updatesvar packages = _jsonSerializer.DeserializeFromStream<List<PackageInfo>>(json).ToList();+ packages = FilterPackages(packages).ToList();+_lastPackageListResult = new Tuple<List<PackageInfo>, DateTime>(packages, DateTime.UtcNow);- return FilterPackages(packages, packageType, applicationVersion);+ return _lastPackageListResult.Item1;+ }+ }++ protected IEnumerable<PackageInfo> FilterPackages(List<PackageInfo> packages)+ {+ foreach (var package in packages)+ {+ package.versions = package.versions.Where(v => !string.IsNullOrWhiteSpace(v.sourceUrl))+ .OrderByDescending(v => v.version).ToList();}++ // Remove packages with no versions+ packages = packages.Where(p => p.versions.Any()).ToList();++ return packages;}protected IEnumerable<PackageInfo> FilterPackages(List<PackageInfo> packages, PackageType? packageType, Version applicationVersion)diff --git a/MediaBrowser.Common/Updates/IInstallationManager.cs b/MediaBrowser.Common/Updates/IInstallationManager.csindex 143a90b856..6ef90ac5f4 100644--- a/MediaBrowser.Common/Updates/IInstallationManager.cs+++ b/MediaBrowser.Common/Updates/IInstallationManager.cs@@ -56,12 +56,8 @@ namespace MediaBrowser.Common.Updates/// Gets all available packages from a static resource./// </summary>/// <param name="cancellationToken">The cancellation token.</param>- /// <param name="packageType">Type of the package.</param>- /// <param name="applicationVersion">The application version.</param>/// <returns>Task{List{PackageInfo}}.</returns>- Task<IEnumerable<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken,- PackageType? packageType = null,- Version applicationVersion = null);+ Task<IEnumerable<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken);/// <summary>/// Gets the package.diff --git a/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs b/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.csindex a91dbbe4cf..e1f00951ec 100644--- a/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs+++ b/MediaBrowser.Server.Implementations/HttpServer/NativeWebSocket.cs@@ -25,7 +25,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer/// <value>The web socket.</value>private System.Net.WebSockets.WebSocket WebSocket { get; set; }- private CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();+ private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();/// <summary>/// Initializes a new instance of the <see cref="NativeWebSocket" /> class.@@ -168,7 +168,6 @@ namespace MediaBrowser.Server.Implementations.HttpServerif (dispose){_cancellationTokenSource.Cancel();- _cancellationTokenSource.Dispose();WebSocket.Dispose();}diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspecindex af32bf8dd9..0513cf965f 100644--- a/Nuget/MediaBrowser.Common.Internal.nuspec+++ b/Nuget/MediaBrowser.Common.Internal.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common.Internal</id>- <version>3.0.210</version>+ <version>3.0.211</version><title>MediaBrowser.Common.Internal</title><authors>Luke</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.210" />+ <dependency id="MediaBrowser.Common" version="3.0.211" /><dependency id="NLog" version="2.0.1.2" /><dependency id="ServiceStack.Text" version="3.9.58" /><dependency id="SimpleInjector" version="2.3.2" />diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspecindex ccc5368573..ece6a953f6 100644--- a/Nuget/MediaBrowser.Common.nuspec+++ b/Nuget/MediaBrowser.Common.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common</id>- <version>3.0.210</version>+ <version>3.0.211</version><title>MediaBrowser.Common</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspecindex a9aa6e4572..79ee652834 100644--- a/Nuget/MediaBrowser.Server.Core.nuspec+++ b/Nuget/MediaBrowser.Server.Core.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Server.Core</id>- <version>3.0.210</version>+ <version>3.0.211</version><title>Media Browser.Server.Core</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains core components required to build plugins for Media Browser Server.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.210" />+ <dependency id="MediaBrowser.Common" version="3.0.211" /></dependencies></metadata><files>