Commit b9cf54a7 authored by Tobias's avatar Tobias

fix build errors

parent f35b7621
......@@ -7,7 +7,7 @@ platform :ios, '7.0'
pod 'OBSlider', '1.1.0'
pod 'InAppSettingsKit', '2.2.2'
pod 'upnpx', '~>1.3.4'
pod 'upnpx', '~>1.3'
pod 'HockeySDK', '~>3.6.4'
pod 'SSKeychain', :git => 'git://github.com/fkuehne/sskeychain.git' #iCloud Keychain sync
pod 'box-ios-sdk-v2', :git => 'git://github.com/fkuehne/box-ios-sdk-v2.git' #has a logout function added
......@@ -27,5 +27,6 @@ target 'VLC-TV' do
platform :tvos, '9.0'
pod 'SSKeychain', :git => 'git://github.com/fkuehne/sskeychain.git' #iCloud Keychain Sync
pod 'box-ios-sdk-v2', :git => 'git://github.com/fkuehne/box-ios-sdk-v2.git' #has tvOS support added
pod 'upnpx', '~>1.3'
end
......@@ -7,7 +7,7 @@ PODS:
- OBSlider (1.1.0)
- RESideMenu (4.0.7)
- SSKeychain (1.2.3)
- upnpx (1.3.4)
- upnpx (1.3.5)
DEPENDENCIES:
- box-ios-sdk-v2 (from `git://github.com/fkuehne/box-ios-sdk-v2.git`)
......@@ -16,7 +16,7 @@ DEPENDENCIES:
- OBSlider (= 1.1.0)
- RESideMenu (~> 4.0.7)
- SSKeychain (from `git://github.com/fkuehne/sskeychain.git`)
- upnpx (~> 1.3.4)
- upnpx (~> 1.3)
EXTERNAL SOURCES:
box-ios-sdk-v2:
......@@ -39,6 +39,6 @@ SPEC CHECKSUMS:
OBSlider: 490f108007bfdd5414a38650b211fe403a95b8a0
RESideMenu: f24c508404b49c667344c54aba7e590883533958
SSKeychain: 3f42991739c6c60a9cf1bbd4dff6c0d3694bcf3d
upnpx: 790dcf9598818385d881ca39a5b77b184b7d291a
upnpx: 10ea9a98bbda350dda836c93eddbe5903b857ec8
COCOAPODS: 0.39.0
......@@ -39,11 +39,12 @@
return _httpParser;
}
- (void)netServiceDidResolveAddress:(NSNetService *)sender {
#if !TARGET_OS_TV
NSString *ownHostname = [[VLCHTTPUploaderController sharedInstance] hostname];
if ([[sender hostName] rangeOfString:ownHostname].location != NSNotFound) {
return;
}
#endif
[self.httpParser checkNetserviceForVLCService:sender];
}
......
......@@ -72,7 +72,15 @@
- (void)loadContents
{
NSArray *dicts = [self.plexParser PlexMediaServerParser:self.plexServerAddress port:self.plexServerPort navigationPath:self.plexServerPath authentification:self.plexAuthentification];
NSError *error = nil;
NSArray *dicts = [self.plexParser PlexMediaServerParser:self.plexServerAddress port:self.plexServerPort navigationPath:self.plexServerPath authentification:self.plexAuthentification error:&error];
if (error) {
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
[self.delegate networkServerBrowser:self requestDidFailWithError:error];
}];
return;
}
NSDictionary *firstObject = [dicts firstObject];
NSString *newAuth = firstObject[@"authentification"] ?: @"";
......
......@@ -12,7 +12,7 @@
#import <UIKit/UIKit.h>
@interface VLCPlexParser : NSObject
- (NSArray *)PlexMediaServerParser:(NSString *)adress port:(NSNumber *)port navigationPath:(NSString *)navPath authentification:(NSString *)auth;
- (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
......@@ -26,7 +26,7 @@ static NSString *const kPlexVLCDeviceName = @"VLC for iOS";
@implementation VLCPlexParser
- (NSArray *)PlexMediaServerParser:(NSString *)address port:(NSNumber *)port navigationPath:(NSString *)path authentification:(NSString *)auth
- (NSArray *)PlexMediaServerParser:(NSString *)address port:(NSNumber *)port navigationPath:(NSString *)path authentification:(NSString *)auth error:(NSError *__autoreleasing *)outError
{
_containerInfo = [[NSMutableArray alloc] init];
_dicoInfo = [[NSMutableDictionary alloc] init];
......@@ -80,14 +80,39 @@ static NSString *const kPlexVLCDeviceName = @"VLC for iOS";
error = nil;
data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
if ([response statusCode] != 200) {
VLCAlertView *alertView = [[VLCAlertView alloc] initWithTitle:NSLocalizedString(@"PLEX_ERROR_ACCOUNT", nil) message:NSLocalizedString(@"PLEX_CHECK_ACCOUNT", nil) cancelButtonTitle:NSLocalizedString(@"BUTTON_OK", nil) otherButtonTitles:nil];
[alertView performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:NO];
if (outError) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:
@{
NSLocalizedDescriptionKey : NSLocalizedString(@"PLEX_ERROR_ACCOUNT", nil),
NSLocalizedFailureReasonErrorKey : NSLocalizedString(@"PLEX_CHECK_ACCOUNT", nil),
}];
if (error) {
userInfo[NSUnderlyingErrorKey] = error;
}
*outError = [NSError errorWithDomain:@"org.videolan.vlc-ios.plexParser"
code:response.statusCode
userInfo:userInfo];
}
}
[_containerInfo removeAllObjects];
[_dicoInfo removeAllObjects];
} else {
VLCAlertView *alertView = [[VLCAlertView alloc] initWithTitle:NSLocalizedString(@"UNAUTHORIZED", nil) message:NSLocalizedString(@"PLEX_CHECK_ACCOUNT", nil) cancelButtonTitle:NSLocalizedString(@"BUTTON_OK", nil) otherButtonTitles:nil];
[alertView performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:NO];
if (outError) {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:
@{
NSLocalizedDescriptionKey : NSLocalizedString(@"UNAUTHORIZED", nil),
NSLocalizedFailureReasonErrorKey : NSLocalizedString(@"PLEX_CHECK_ACCOUNT", nil),
}];
if (error) {
userInfo[NSUnderlyingErrorKey] = error;
}
*outError = [NSError errorWithDomain:@"org.videolan.vlc-ios.plexParser"
code:response.statusCode
userInfo:userInfo];
}
}
} else
APLog(@"PlexParser url Errors : %ld", (long)[response statusCode]);
......
......@@ -20,7 +20,7 @@
- (NSURL *)CreatePlexStreamingURL:(NSString *)address port:(NSString *)port videoKey:(NSString *)key username:(NSString *)username deviceInfo:(NSDictionary *)deviceInfo session:(NSString *)session;
- (void)stopSession:(NSString *)adress port:(NSString *)port session:(NSString *)session;
- (NSInteger)MarkWatchedUnwatchedMedia:(NSString *)address port:(NSString *)port videoRatingKey:(NSString *)ratingKey state:(NSString *)state authentification:(NSString *)auth;
- (NSString *)getFileSubtitleFromPlexServer:(NSDictionary *)mediaObject modeStream:(BOOL)modeStream;
- (NSString *)getFileSubtitleFromPlexServer:(NSDictionary *)mediaObject modeStream:(BOOL)modeStream error:(NSError *__autoreleasing*)error;
- (NSString *)getSession;
- (NSData *)PlexDeviceInfo:(NSArray *)cookies;
......
......@@ -12,6 +12,7 @@
#import "VLCPlexWebAPI.h"
#import "VLCPlexParser.h"
#import "UIDevice+VLC.h"
#import "sysexits.h"
#define kPlexMediaServerSignIn @"https://plex.tv/users/sign_in.xml"
#define kPlexURLdeviceInfo @"https://plex.tv/devices.xml"
......@@ -187,7 +188,7 @@
return httpStatus;
}
- (NSString *)getFileSubtitleFromPlexServer:(NSDictionary *)mediaObject modeStream:(BOOL)modeStream
- (NSString *)getFileSubtitleFromPlexServer:(NSDictionary *)mediaObject modeStream:(BOOL)modeStream error:(NSError *__autoreleasing *)outError
{
if (!mediaObject)
return @"";
......@@ -217,12 +218,17 @@
}
[receivedSub writeToFile:FileSubtitlePath atomically:YES];
} else {
VLCAlertView *alert = [[VLCAlertView alloc] initWithTitle:NSLocalizedString(@"DISK_FULL", nil)
message:[NSString stringWithFormat:NSLocalizedString(@"DISK_FULL_FORMAT", nil), fileName, [[UIDevice currentDevice] model]]
delegate:self
cancelButtonTitle:NSLocalizedString(@"BUTTON_OK", nil)
otherButtonTitles:nil];
[alert show];
NSString *title = NSLocalizedString(@"DISK_FULL", nil);
NSString *message = [NSString stringWithFormat:NSLocalizedString(@"DISK_FULL_FORMAT", nil), fileName, [[UIDevice currentDevice] model]];
if (outError) {
*outError = [NSError errorWithDomain:@"org.videolan.vlc-ios.plex"
code:EX_CANTCREAT
userInfo:@{NSLocalizedDescriptionKey : title,
NSLocalizedFailureReasonErrorKey : message
}];
}
}
return FileSubtitlePath;
......
......@@ -23,6 +23,11 @@
#import "UIColor+Presets.h"
#import "VLCTVConstants.h"
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[UIDevice currentDevice] systemVersion].floatValue >= [v floatValue])
#define SYSTEM_RUNS_IOS8_OR_LATER SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")
#ifndef NDEBUG
#define APLog(format, ...) NSLog(format, ## __VA_ARGS__)
#else
......
......@@ -275,9 +275,7 @@
DD3EFEED1BDEBA3800B68579 /* VLCNetworkServerBrowserViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFEEA1BDEBA3800B68579 /* VLCNetworkServerBrowserViewController.m */; };
DD3EFEEE1BDEBA3800B68579 /* VLCServerListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFEEC1BDEBA3800B68579 /* VLCServerListViewController.m */; };
DD3EFF2D1BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserFTP.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFEF21BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserFTP.m */; };
DD3EFF2E1BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserFTP.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFEF21BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserFTP.m */; };
DD3EFF311BDEBCE500B68579 /* VLCNetworkServerBrowserFTP.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFEF61BDEBCE500B68579 /* VLCNetworkServerBrowserFTP.m */; };
DD3EFF321BDEBCE500B68579 /* VLCNetworkServerBrowserFTP.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFEF61BDEBCE500B68579 /* VLCNetworkServerBrowserFTP.m */; };
DD3EFF331BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserMediaDiscoverer.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFEF91BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserMediaDiscoverer.m */; };
DD3EFF341BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserMediaDiscoverer.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFEF91BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserMediaDiscoverer.m */; };
DD3EFF351BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserNetService.m in Sources */ = {isa = PBXBuildFile; fileRef = DD3EFEFB1BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserNetService.m */; };
......@@ -2631,7 +2629,6 @@
7DEC8BED1BD68D6A006E1093 /* VLCAboutTVViewController.m in Sources */,
7DEC8BD81BD66DA8006E1093 /* VLCMiniPlaybackView.m in Sources */,
DD3EFF5A1BDEBCE500B68579 /* VLCLocalNetworkServiceUPnP.m in Sources */,
DD3EFF2E1BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserFTP.m in Sources */,
DD3EFF3A1BDEBCE500B68579 /* VLCLocalNetworkServiceVLCMedia.m in Sources */,
7D7EF3DA1BD56B5900CD4CEE /* VLCOpenNetworkStreamTVViewController.m in Sources */,
DD3EFF521BDEBCE500B68579 /* VLCPlexWebAPI.m in Sources */,
......@@ -2661,7 +2658,6 @@
7DC71D291BC83590001FACAA /* UIColor+Presets.m in Sources */,
7D4408591BDA8DCA0080FB42 /* VLCBoxController.m in Sources */,
DD3EFF341BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserMediaDiscoverer.m in Sources */,
DD3EFF321BDEBCE500B68579 /* VLCNetworkServerBrowserFTP.m in Sources */,
DD3EFF421BDEBCE500B68579 /* VLCNetworkServerBrowserSharedLibrary.m in Sources */,
7D5278E41BD7E37300D0CA0E /* VLCCloudStorageController.m in Sources */,
7D60696A1BD93ABF00AB765C /* VLCCloudStorageTableViewController.m in Sources */,
......
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