Commit b5934d33 authored by Felix Paul Kühne's avatar Felix Paul Kühne

plex: use file name provided by server to store media, not display name

(cherry picked from commit 73d45236)
parent 1ab9d9fa
......@@ -26,6 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface VLCNetworkServerBrowserItemPlex : NSObject <VLCNetworkServerBrowserItem>
- (instancetype)initWithDictionary:(NSDictionary *)dictionary currentURL:(NSURL *)currentURL authentificication:(NSString *)auth;
@property (nonatomic, readonly, nullable) NSString *filename;
@property (nonatomic, readonly, nullable) NSString *duration;
@property (nonatomic, readonly, nullable) NSURL *subtitleURL;
@property (nonatomic, readonly, nullable) NSURL *thumbnailURL;
......
......@@ -190,6 +190,7 @@
_duration = dictionary[@"duration"];
_fileSizeBytes = dictionary[@"size"];
_filename = dictionary[@"namefile"];
NSString *subtitleURLString = dictionary[@"keySubtitle"];
if (subtitleURLString) {
......
......@@ -47,6 +47,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, readonly, nullable) NSNumber *fileSizeBytes;
@optional
@property (nonatomic, readonly, nullable) NSString *filename;
@property (nonatomic, readonly, nullable) NSString *duration;
@property (nonatomic, readonly, nullable) NSURL *subtitleURL;
@property (nonatomic, readonly, nullable) NSURL *thumbnailURL;
......
......@@ -253,7 +253,12 @@
- (void)_downloadItem:(id<VLCNetworkServerBrowserItem>)item
{
NSString *filename = item.name;
NSString *filename;
if ([item respondsToSelector:@selector(filename)])
filename = item.filename;
else
filename = item.name;
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) */
NSString *urlExtension = item.URL.pathExtension;
......
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