Commit 96baf102 authored by Felix Paul Kühne's avatar Felix Paul Kühne

UPnP: correctly recognize some audio contents

parent 01a105d7
...@@ -238,12 +238,16 @@ ...@@ -238,12 +238,16 @@
NSArray<NSString *>* protocolStrings = [[mediaItem uriCollection] allKeys]; NSArray<NSString *>* protocolStrings = [[mediaItem uriCollection] allKeys];
protocolStrings = [protocolStrings filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSString * _Nonnull evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) { protocolStrings = [protocolStrings filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(NSString * _Nonnull evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {
return [evaluatedObject containsString:@"http-get:*:video/"]; if ([evaluatedObject containsString:@"http-get:*:video/"])
return YES;
if ([evaluatedObject containsString:@"http-get:*:audio/"])
return YES;
return NO;
}]]; }]];
if (protocolStrings.count == 1) { if (protocolStrings.count == 1) {
_URL = [NSURL URLWithString:[mediaItem uri]]; _URL = [NSURL URLWithString:[mediaItem uri]];
} else if (protocolStrings.count > 1) { } else if (protocolStrings.count > 1) {
// whith mutlple playable ressources we simulate to be a container // withh multiple playable resources we simulate to be a container
_container = YES; _container = YES;
} }
} }
......
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
if (filename.pathExtension.length == 0) { if (filename.pathExtension.length == 0) {
/* there are few crappy UPnP servers who don't reveal the correct file extension, so we use a generic fake (#11123) */ /* there are few crappy UPnP servers who don't reveal the correct file extension, so we use a generic fake (#11123) */
NSString *urlExtension = item.URL.pathExtension; NSString *urlExtension = item.URL.pathExtension;
NSString *extension = urlExtension.length!=0 ? urlExtension : @"vlc"; NSString *extension = urlExtension.length != 0 ? urlExtension : @"vlc";
filename = [filename stringByAppendingPathExtension:extension]; filename = [filename stringByAppendingPathExtension:extension];
} }
[[VLCDownloadViewController sharedInstance] addURLToDownloadList:item.URL [[VLCDownloadViewController sharedInstance] addURLToDownloadList:item.URL
......
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