mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
Removed guids from the model project
This commit is contained in:
@@ -13,6 +13,7 @@ using MediaBrowser.Common.Progress;
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Common.Updates;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
||||
@@ -531,7 +531,7 @@ namespace MediaBrowser.Common.Implementations.ScheduledTasks
|
||||
EndTimeUtc = endTime,
|
||||
Status = status,
|
||||
Name = Name,
|
||||
Id = Id
|
||||
Id = Id.ToString("N")
|
||||
};
|
||||
|
||||
if (ex != null)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Events;
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
using MediaBrowser.Model.Events;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user