Skip to content

Commit

Permalink
Each user profiles need a dedicated cacheKey
Browse files Browse the repository at this point in the history
This ensures the App's cached library content matches the content reachable for the active user profile.
  • Loading branch information
wutschel committed Dec 21, 2024
1 parent 2dd3574 commit df6fcf2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion XBMC Remote/DetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,17 @@ - (NSString*)getCacheKey:(NSString*)fieldA parameters:(NSMutableDictionary*)fiel
// Which version does the serer have?
NSString *serverVersion = [NSString stringWithFormat:@"%d.%d", serverMajorVersion, serverMinorVersion];

// Which user profile is active?
NSString *currentProfile = [NSString stringWithFormat:@"%@", AppDelegate.instance.currentProfile];

// Which App version are we running?
NSString *appVersion = [Utilities getAppVersionString];

// Which JSON request's results do we cache??
NSString *jsonRequest = [NSString stringWithFormat:@"%@ %@", fieldA, fieldB];

// Get SHA256 hash for the combination given above
NSString *text = [NSString stringWithFormat:@"%@%@%@%@", serverInfo, serverVersion, appVersion, jsonRequest];
NSString *text = [NSString stringWithFormat:@"%@%@%@%@%@", serverInfo, serverVersion, currentProfile, appVersion, jsonRequest];
return [text SHA256String];
}

Expand Down

0 comments on commit df6fcf2

Please sign in to comment.