updated nuget

This commit is contained in:
Luke Pulverenti 2013-09-29 21:29:38 -04:00
parent f7deec40d0
commit 3733ebd21e
6 changed files with 26 additions and 19 deletions

View File

@ -161,12 +161,8 @@ 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="packageType">Type of the package.</param>
/// <param name="applicationVersion">The application version.</param>
/// <returns>Task{List{PackageInfo}}.</returns> /// <returns>Task{List{PackageInfo}}.</returns>
public async Task<IEnumerable<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken, public async Task<IEnumerable<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken)
PackageType? packageType = null,
Version applicationVersion = null)
{ {
if (_lastPackageListResult != null) if (_lastPackageListResult != null)
{ {
@ -187,12 +183,28 @@ namespace MediaBrowser.Common.Implementations.Updates
var packages = _jsonSerializer.DeserializeFromStream<List<PackageInfo>>(json).ToList(); var packages = _jsonSerializer.DeserializeFromStream<List<PackageInfo>>(json).ToList();
packages = FilterPackages(packages).ToList();
_lastPackageListResult = new Tuple<List<PackageInfo>, DateTime>(packages, DateTime.UtcNow); _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) protected IEnumerable<PackageInfo> FilterPackages(List<PackageInfo> packages, PackageType? packageType, Version applicationVersion)
{ {
foreach (var package in packages) foreach (var package in packages)

View File

@ -56,12 +56,8 @@ namespace MediaBrowser.Common.Updates
/// Gets all available packages from a static resource. /// Gets all available packages from a static resource.
/// </summary> /// </summary>
/// <param name="cancellationToken">The cancellation token.</param> /// <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> /// <returns>Task{List{PackageInfo}}.</returns>
Task<IEnumerable<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken, Task<IEnumerable<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken);
PackageType? packageType = null,
Version applicationVersion = null);
/// <summary> /// <summary>
/// Gets the package. /// Gets the package.

View File

@ -25,7 +25,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// <value>The web socket.</value> /// <value>The web socket.</value>
private System.Net.WebSockets.WebSocket WebSocket { get; set; } private System.Net.WebSockets.WebSocket WebSocket { get; set; }
private CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource(); private readonly CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="NativeWebSocket" /> class. /// Initializes a new instance of the <see cref="NativeWebSocket" /> class.
@ -168,7 +168,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer
if (dispose) if (dispose)
{ {
_cancellationTokenSource.Cancel(); _cancellationTokenSource.Cancel();
_cancellationTokenSource.Dispose();
WebSocket.Dispose(); WebSocket.Dispose();
} }

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.210</version> <version>3.0.211</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <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> <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> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <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="NLog" version="2.0.1.2" />
<dependency id="ServiceStack.Text" version="3.9.58" /> <dependency id="ServiceStack.Text" version="3.9.58" />
<dependency id="SimpleInjector" version="2.3.2" /> <dependency id="SimpleInjector" version="2.3.2" />

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.210</version> <version>3.0.211</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.210</version> <version>3.0.211</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description> <description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.210" /> <dependency id="MediaBrowser.Common" version="3.0.211" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>