summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2017-01-25 10:43:59 +0100
committerDamiano Galassi <[email protected]>2017-01-25 10:43:59 +0100
commit79c33c0ca996311224bbd3719c85238a3358cb5e (patch)
tree532256b5d06259f82648fe5f7922ae7c63b36299 /macosx
parent4334419b4adbc78648608ad4076de8005f4c4f27 (diff)
MacGui: select the right title when editing a queue job, libhb avoids rescanning if the same file/folder is loaded.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBController.m18
1 files changed, 17 insertions, 1 deletions
diff --git a/macosx/HBController.m b/macosx/HBController.m
index 2b44aa945..5859f0c6a 100644
--- a/macosx/HBController.m
+++ b/macosx/HBController.m
@@ -673,7 +673,23 @@
{
[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;
}];