Commit fb5d89b5 authored by Tobias's avatar Tobias

fix empty local HTTP share view

don't convert port number to string and back to number
parent 3f31bf21
......@@ -49,7 +49,6 @@ typedef void (^VLCLocalNetworkServiceActionBlock)(void);
@end
@interface VLCLocalNetworkServiceHTTP : VLCLocalNetworkServiceNetService
@property (nonatomic, strong) NSDictionary *seviceDescription;
@end
......
......@@ -118,13 +118,14 @@
}
- (UIViewController *)detailViewController {
NSDictionary *serviceDescription = self.seviceDescription;
if (serviceDescription == nil) {
NSNetService *service = self.netService;
if (service.hostName == nil || service.port == 0) {
return nil;
}
NSString *name = serviceDescription[@"name"];
NSString *hostName = serviceDescription[@"hostName"];
NSString *portNum = serviceDescription[@"port"];
NSString *name = service.name;
NSString *hostName = service.hostName;
NSUInteger portNum = service.port;
VLCSharedLibraryListViewController *targetViewController = [[VLCSharedLibraryListViewController alloc]
initWithHttpServer:name
serverAddress:hostName
......
......@@ -16,6 +16,6 @@
@property (nonatomic, strong) UITableView *tableView;
- (id)initWithHttpServer:(NSString *)serverName serverAddress:(NSString *)serverAddress portNumber:(NSString *)portNumber;
- (id)initWithHttpServer:(NSString *)serverName serverAddress:(NSString *)serverAddress portNumber:(NSUInteger)portNumber;
@end
......@@ -27,7 +27,7 @@
NSString *_httpServerName;
NSString *_httpServerAddress;
NSString *_httpServerPort;
NSUInteger _httpServerPort;
VLCSharedLibraryParser *_httpParser;
NSMutableArray *_searchData;
......@@ -63,7 +63,7 @@
self.view = _tableView;
}
- (id)initWithHttpServer:(NSString *)serverName serverAddress:(NSString *)serverAddress portNumber:(NSString *)portNumber
- (id)initWithHttpServer:(NSString *)serverName serverAddress:(NSString *)serverAddress portNumber:(NSUInteger)portNumber
{
self = [super init];
if (self) {
......@@ -84,7 +84,7 @@
{
[super viewWillAppear:animated];
[_httpParser fetchDataFromServer:_httpServerAddress port:_httpServerPort.longLongValue];
[_httpParser fetchDataFromServer:_httpServerAddress port:_httpServerPort];
}
- (void)viewDidLoad
......@@ -387,7 +387,7 @@
@synchronized(self) {
_serverDataArray = nil;
}
[_httpParser fetchDataFromServer:_httpServerAddress port:_httpServerPort.longLongValue];
[_httpParser fetchDataFromServer:_httpServerAddress port:_httpServerPort];
}
#pragma mark - Gesture Action
......
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