]> granicus.if.org Git - handbrake/commitdiff
WinGui: Improve the QueueTask Surrogate key. It now contains a session id to prevent...
authorsr55 <sr55.hb@outlook.com>
Fri, 18 Aug 2017 21:04:57 +0000 (22:04 +0100)
committersr55 <sr55.hb@outlook.com>
Fri, 18 Aug 2017 21:04:57 +0000 (22:04 +0100)
win/CS/HandBrakeWPF/Services/Queue/Model/QueueTask.cs

index 28e66ba593e67da421390fbe188b83f9310c92ae..be3a8a4b9bb78bc0a0ce4f14c98b2799dc2237f3 100644 (file)
@@ -13,6 +13,8 @@ namespace HandBrakeWPF.Services.Queue.Model
 \r
     using HandBrake.ApplicationServices.Model;\r
 \r
+    using HandBrakeWPF.Utilities;\r
+\r
     using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;\r
 \r
     /// <summary>\r
@@ -20,7 +22,7 @@ namespace HandBrakeWPF.Services.Queue.Model
     /// </summary>\r
     public class QueueTask : PropertyChangedBase\r
     {\r
-        private static int id = 0;\r
+        private static int id;\r
         private QueueItemStatus status;\r
 \r
         #region Properties\r
@@ -32,7 +34,7 @@ namespace HandBrakeWPF.Services.Queue.Model
         {\r
             this.Status = QueueItemStatus.Waiting;\r
             id = id + 1;\r
-            this.Id = id;\r
+            this.Id = string.Format("{0}.{1}", GeneralUtilities.ProcessId, id);\r
         }\r
 \r
         /// <summary>\r
@@ -55,10 +57,10 @@ namespace HandBrakeWPF.Services.Queue.Model
             this.ScannedSourcePath = scannedSourcePath;\r
 \r
             id = id + 1;\r
-            this.Id = id;\r
+            this.Id = string.Format("{0}.{1}", GeneralUtilities.ProcessId, id);\r
         }\r
 \r
-        public int Id { get; private set; }\r
+        public string Id { get; }\r
 \r
         /// <summary>\r
         /// Gets or sets ScannedSource.\r
@@ -109,7 +111,7 @@ namespace HandBrakeWPF.Services.Queue.Model
 \r
         public override int GetHashCode()\r
         {\r
-            return this.Id;\r
+            return this.Id.GetHashCode();\r
         }\r
     }\r
 }
\ No newline at end of file