]> 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 09:43:59 +0000 (10:43 +0100)
macosx/HBController.m

index 2b44aa94579727f4a2e44e66b42906aab6199286..5859f0c6abddbd83c43acab2a383978e64f58758 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;
         }];