diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-05-08 16:09:53 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-05-08 16:09:53 -0400 |
| commit | f02c3260273a09f465c4e7a97d8b90f0f6909734 (patch) | |
| tree | 180760af62fcddc1964e000c6c57bd368dce836d /MediaBrowser.Common.Implementations/Updates | |
| parent | 374dd8d44152e49f4616a9c8c3d36e8793ed037e (diff) | |
Removed guids from the model project
Diffstat (limited to 'MediaBrowser.Common.Implementations/Updates')
| -rw-r--r-- | MediaBrowser.Common.Implementations/Updates/InstallationManager.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs index 18462ba9b..92e5f894f 100644 --- a/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs +++ b/MediaBrowser.Common.Implementations/Updates/InstallationManager.cs @@ -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)); } |
