diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index f741e9a..f259dde 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -696,13 +696,31 @@ static NSMutableSet* hostList; _sortedAppList = [host.appList allObjects]; _sortedAppList = [_sortedAppList sortedArrayUsingSelector:@selector(compareName:)]; - // Start populating the box art cache asynchronously + // Split the sorted array in half to allow 2 jobs to process app assets at once + NSArray *firstHalf; + NSArray *secondHalf; + NSRange range; + + range.location = 0; + range.length = [_sortedAppList count] / 2; + + firstHalf = [_sortedAppList subarrayWithRange:range]; + + range.location = range.length; + range.length = [_sortedAppList count] - range.length; + + secondHalf = [_sortedAppList subarrayWithRange:range]; + + // Start 2 jobs dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - Log(LOG_I, @"Starting per-computer box art caching job"); - for (App* app in host.appList) { + for (App* app in firstHalf) { + [self updateBoxArtCacheForApp:app]; + } + }); + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + for (App* app in secondHalf) { [self updateBoxArtCacheForApp:app]; } - Log(LOG_I, @"Per-computer box art caching job completed"); }); [hostScrollView removeFromSuperview];