From: sr55 Date: Fri, 18 Aug 2017 21:04:57 +0000 (+0100) Subject: WinGui: Improve the QueueTask Surrogate key. It now contains a session id to prevent... X-Git-Tag: 1.1.0~416 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=680f04f8864999c742f071a0b1dad926104ec4fd;p=handbrake WinGui: Improve the QueueTask Surrogate key. It now contains a session id to prevent issues with the queue reloads. --- diff --git a/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs b/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs index 28e66ba59..be3a8a4b9 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs @@ -13,6 +13,8 @@ namespace HandBrakeWPF.Services.Queue.Model using HandBrake.ApplicationServices.Model; + using HandBrakeWPF.Utilities; + using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask; /// @@ -20,7 +22,7 @@ namespace HandBrakeWPF.Services.Queue.Model /// public class QueueTask : PropertyChangedBase { - private static int id = 0; + private static int id; private QueueItemStatus status; #region Properties @@ -32,7 +34,7 @@ namespace HandBrakeWPF.Services.Queue.Model { this.Status = QueueItemStatus.Waiting; id = id + 1; - this.Id = id; + this.Id = string.Format("{0}.{1}", GeneralUtilities.ProcessId, id); } /// @@ -55,10 +57,10 @@ namespace HandBrakeWPF.Services.Queue.Model this.ScannedSourcePath = scannedSourcePath; id = id + 1; - this.Id = id; + this.Id = string.Format("{0}.{1}", GeneralUtilities.ProcessId, id); } - public int Id { get; private set; } + public string Id { get; } /// /// Gets or sets ScannedSource. @@ -109,7 +111,7 @@ namespace HandBrakeWPF.Services.Queue.Model public override int GetHashCode() { - return this.Id; + return this.Id.GetHashCode(); } } } \ No newline at end of file