Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Minor future-compatible update for auth.getMobileSession method
Browse files Browse the repository at this point in the history
  • Loading branch information
username0x0a committed Oct 24, 2016
1 parent e138da5 commit 3586a8f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions LastFm/LastFm.m
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ - (NSOperation *)_performApiCallForMethod:(NSString*)method
NSArray *methodParts = [method componentsSeparatedByString:@"."];
if ([methodParts count] > 1) {
NSString *secondPart = [methodParts objectAtIndex:1];
if ([secondPart hasPrefix:@"get"]) {
if ([secondPart hasPrefix:@"get"] && ![method isEqualToString:@"auth.getMobileSession"]) {
doPost = NO;
}
}
Expand Down Expand Up @@ -852,7 +852,6 @@ - (NSOperation *)createUserWithUsername:(NSString *)username password:(NSString
- (NSOperation *)getSessionForUser:(NSString *)username password:(NSString *)password successHandler:(LastFmReturnBlockWithDictionary)successHandler failureHandler:(LastFmReturnBlockWithError)failureHandler {
username = [self forceString:username];
password = [self forceString:password];
NSString *authToken = [self md5sumFromString:[NSString stringWithFormat:@"%@%@", [username lowercaseString], [self md5sumFromString:password]]];

NSDictionary *mappingObject = @{
@"name": @[ @"./name", @"NSString" ],
Expand All @@ -862,7 +861,7 @@ - (NSOperation *)getSessionForUser:(NSString *)username password:(NSString *)pas

return [self performApiCallForMethod:@"auth.getMobileSession"
useCache:NO
withParams:@{ @"username": [username lowercaseString], @"authToken": authToken }
withParams:@{ @"username": [username lowercaseString], @"password": password }
rootXpath:@"./session"
returnDictionary:YES
mappingObject:mappingObject
Expand Down

0 comments on commit 3586a8f

Please sign in to comment.