Removed guids from the model project

This commit is contained in:
Luke Pulverenti
2014-05-08 16:09:53 -04:00
parent 374dd8d441
commit f02c326027
72 changed files with 380 additions and 503 deletions

View File

@@ -5,6 +5,7 @@ using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.Progress;
using MediaBrowser.Common.Security;
using MediaBrowser.Common.Updates;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Updates;
@@ -367,7 +368,7 @@ namespace MediaBrowser.Common.Implementations.Updates
var installationInfo = new InstallationInfo
{
Id = Guid.NewGuid(),
Id = Guid.NewGuid().ToString("N"),
Name = package.name,
AssemblyGuid = package.guid,
UpdateClass = package.classification,
@@ -510,13 +511,14 @@ namespace MediaBrowser.Common.Implementations.Updates
cancellationToken.ThrowIfCancellationRequested();
// Validate with a checksum
if (package.checksum != Guid.Empty) // support for legacy uploads for now
var packageChecksum = string.IsNullOrWhiteSpace(package.checksum) ? Guid.Empty : new Guid(package.checksum);
if (packageChecksum != Guid.Empty) // support for legacy uploads for now
{
using (var crypto = new MD5CryptoServiceProvider())
using (var stream = new BufferedStream(File.OpenRead(tempFile), 100000))
{
var check = Guid.Parse(BitConverter.ToString(crypto.ComputeHash(stream)).Replace("-", String.Empty));
if (check != package.checksum)
if (check != packageChecksum)
{
throw new ApplicationException(string.Format("Download validation failed for {0}. Probably corrupted during transfer.", package.name));
}