Commit 4e900e80 authored by Felix Paul Kühne's avatar Felix Paul Kühne

server browsing: correctly implement 'isDownloadable' flag for shares browsed by VLC

parent 591a34aa
......@@ -20,6 +20,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface VLCNetworkServerBrowserItemVLCMedia : NSObject <VLCNetworkServerBrowserItem>
- (instancetype)initWithMedia:(VLCMedia *)media options:(NSDictionary *)mediaOptions;
@property (nonatomic, getter=isDownloadable, readonly) BOOL downloadable;
@end
NS_ASSUME_NONNULL_END
\ No newline at end of file
......@@ -123,7 +123,7 @@
@end
@implementation VLCNetworkServerBrowserItemVLCMedia
@synthesize name = _name, container = _container, fileSizeBytes = _fileSizeBytes, URL = _URL, media = _media;
@synthesize name = _name, container = _container, fileSizeBytes = _fileSizeBytes, URL = _URL, media = _media, downloadable = _downloadable;
- (instancetype)initWithMedia:(VLCMedia *)media options:(NSDictionary *)mediaOptions;
{
......@@ -144,7 +144,7 @@
_name = title;
_URL = media.url;
_mediaOptions = [mediaOptions copy];
// _downloadable = NO; //TODO: add property for downloadable?
_downloadable = NO;
}
return self;
}
......
......@@ -96,7 +96,10 @@
}
cell.subtitle = subtitle;
#if DOWNLOAD_SUPPORTED
cell.isDownloadable = self.allowsFileDownload;
if ([item respondsToSelector:@selector(isDownloadable)])
cell.isDownloadable = item.isDownloadable;
else
cell.isDownloadable = NO;
#endif
}
cell.title = item.name;
......
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