Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: restore GlobalSearch sort method and sort order #1185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions XBMC Remote/DetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -5764,12 +5764,10 @@ - (BOOL)collectionViewIsEnabled {

- (NSString*)getCurrentSortMethod:(NSDictionary*)methods withParameters:(NSDictionary*)parameters {
NSString *sortMethod = parameters[@"parameters"][@"sort"][@"method"];
if (methods != nil) {
NSString *sortKey = [NSString stringWithFormat:@"%@_sort_method", [self getCacheKey:methods[@"method"] parameters:[parameters mutableCopy]]];
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if ([userDefaults objectForKey:sortKey] != nil) {
sortMethod = [userDefaults objectForKey:sortKey];
}
NSString *sortKey = [NSString stringWithFormat:@"%@_sort_method", [self getCacheKey:methods[@"method"] parameters:[parameters mutableCopy]]];
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if ([userDefaults objectForKey:sortKey] != nil) {
sortMethod = [userDefaults objectForKey:sortKey];
}
return sortMethod;
}
Expand Down Expand Up @@ -5930,12 +5928,10 @@ - (NSMutableArray*)sortfilteredList:(NSArray*)resultsList {

- (NSString*)getCurrentSortAscDesc:(NSDictionary*)methods withParameters:(NSDictionary*)parameters {
NSString *sortAscDescSaved = parameters[@"parameters"][@"sort"][@"order"];
if (methods != nil) {
NSString *sortKey = [NSString stringWithFormat:@"%@_sort_ascdesc", [self getCacheKey:methods[@"method"] parameters:[parameters mutableCopy]]];
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if ([userDefaults objectForKey:sortKey] != nil) {
sortAscDescSaved = [userDefaults objectForKey:sortKey];
}
NSString *sortKey = [NSString stringWithFormat:@"%@_sort_ascdesc", [self getCacheKey:methods[@"method"] parameters:[parameters mutableCopy]]];
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
if ([userDefaults objectForKey:sortKey] != nil) {
sortAscDescSaved = [userDefaults objectForKey:sortKey];
}
return sortAscDescSaved;
}
Expand Down