Commit 7c886c04 authored by Pierre SAGASPE's avatar Pierre SAGASPE

plex : fix keychain service format

parent 3a5a52e2
......@@ -2,7 +2,7 @@
* VLCPlexParser.h
* VLC for iOS
*****************************************************************************
* Copyright (c) 2014-2015 VideoLAN. All rights reserved.
* Copyright (c) 2014-2017 VideoLAN. All rights reserved.
*
* Authors: Pierre Sagaspe <pierre.sagaspe # me.com>
*
......@@ -15,4 +15,4 @@
- (NSArray *)PlexMediaServerParser:(NSString *)adress port:(NSNumber *)port navigationPath:(NSString *)navPath authentification:(NSString *)auth error:(NSError *__autoreleasing *)error;
- (NSArray *)PlexExtractDeviceInfo:(NSData *)data;
@end
\ No newline at end of file
@end
......@@ -2,7 +2,7 @@
* VLCPlexParser.m
* VLC for iOS
*****************************************************************************
* Copyright (c) 2014-2015 VideoLAN. All rights reserved.
* Copyright (c) 2014-2017 VideoLAN. All rights reserved.
*
* Authors: Pierre Sagaspe <pierre.sagaspe # me.com>
*
......@@ -62,10 +62,10 @@ static NSString *const kPlexVLCDeviceName = @"VLC for iOS";
if ([response statusCode] != 200) {
NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
if([responseString rangeOfString:@"Unauthorized"].location != NSNotFound) {
NSString *serviceString = [NSString stringWithFormat:@"plex://%@%@", address, port];
NSString *serviceString = [NSString stringWithFormat:@"plex://%@:%@", address, port];
XKKeychainGenericPasswordItem *keychainItem = [XKKeychainGenericPasswordItem itemsForService:serviceString error:nil].firstObject;
if (!keychainItem) {
serviceString = @"plex://Account";
serviceString = [NSString stringWithFormat:@"plex://Account:%@", port];
keychainItem = [XKKeychainGenericPasswordItem itemsForService:serviceString error:nil].firstObject;
}
if (keychainItem) {
......@@ -231,4 +231,4 @@ static NSString *const kPlexVLCDeviceName = @"VLC for iOS";
}
}
@end
\ No newline at end of file
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment