From 680f04f8864999c742f071a0b1dad926104ec4fd Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 18 Aug 2017 22:04:57 +0100 Subject: [PATCH] WinGui: Improve the QueueTask Surrogate key. It now contains a session id to prevent issues with the queue reloads. --- .../HandBrakeWPF/Services/Queue/Model/QueueTask.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 -- 2.40.0