summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
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;
}];