]> granicus.if.org Git - handbrake/commitdiff
MacGui: select the right title when editing a queue job, libhb avoids rescanning...
authorDamiano Galassi <damiog@gmail.com>
Wed, 25 Jan 2017 09:43:59 +0000 (10:43 +0100)
committerDamiano Galassi <damiog@gmail.com>
Wed, 25 Jan 2017 10:04:45 +0000 (11:04 +0100)
(cherry picked from commit 79c33c0ca996311224bbd3719c85238a3358cb5e)

macosx/HBController.m

index 4a7605c613d18ef0c23b017b9f39b120cfeab199..946a3908a9b38b5210f68431be456b4d2ea14f8a 100644 (file)
     {
         [self scanURL:job.fileURL titleIndex:job.titleIdx completionHandler:^(NSArray<HBTitle *> *titles)
         {
-            job.title = titles.firstObject;
+            // If the scan was cached, reselect
+            // the original title
+            for (HBTitle *title in titles)
+            {
+                if (title.index == job.titleIdx)
+                {
+                    job.title = title;
+                    break;
+                }
+            }
+
+            // Else just one title or a title specific rescan
+            // select the first title
+            if (!job.title)
+            {
+                job.title = titles.firstObject;
+            }
             self.job = job;
         }];