Commit 23348522 authored by Soomin Lee's avatar Soomin Lee Committed by Carola Nitz

tvOS: Dropbox migration

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: default avatarCarola Nitz <nitz.carola@googlemail.com>
parent 2e32c4d9
......@@ -10,7 +10,6 @@
*****************************************************************************/
#import "VLCCloudServicesTVViewController.h"
#import <DropboxTVSDK/DropboxSDK.h>
#import "VLCDropboxController.h"
#import "VLCDropboxCollectionViewController.h"
#import "VLCPlayerDisplayController.h"
......
......@@ -19,7 +19,7 @@
@interface VLCRemoteBrowsingTVCell (CloudStorage)
- (void)setDropboxFile:(DBMetadata *)dropboxFile;
- (void)setDropboxFile:(DBFILESMetadata *)dropboxFile;
- (void)setBoxFile:(BoxItem *)boxFile;
- (void)setOneDriveFile:(VLCOneDriveObject *)oneDriveFile;
......
......@@ -15,7 +15,7 @@
@implementation VLCRemoteBrowsingTVCell (CloudStorage)
- (void)setDropboxFile:(DBMetadata *)dropboxFile
- (void)setDropboxFile:(DBFILESMetadata *)dropboxFile
{
[self performSelectorOnMainThread:@selector(_updateDropboxRepresentation:)
withObject:dropboxFile waitUntilDone:NO];
......@@ -33,26 +33,21 @@
withObject:oneDriveFile waitUntilDone:NO];
}
- (void)_updateDropboxRepresentation:(DBMetadata *)dropboxFile
- (void)_updateDropboxRepresentation:(DBFILESMetadata *)dropboxFile
{
if (dropboxFile != nil) {
if (dropboxFile.isDirectory) {
if ([dropboxFile isKindOfClass: [DBFILESFolderMetadata class]]) {
self.isDirectory = YES;
self.title = dropboxFile.filename;
self.thumbnailImage = [UIImage imageNamed:@"folder"];
} else {
self.isDirectory = NO;
self.subtitle = (dropboxFile.totalBytes > 0) ? dropboxFile.humanReadableSize : @"";
}
self.title = dropboxFile.filename;
DBFILESFileMetadata *file = (DBFILESFileMetadata *)dropboxFile;
NSString *iconName = dropboxFile.icon;
if ([iconName isEqualToString:@"folder_user"] || [iconName isEqualToString:@"folder"] || [iconName isEqualToString:@"folder_public"] || [iconName isEqualToString:@"folder_photos"] || [iconName isEqualToString:@"package"]) {
self.isDirectory = NO;
self.subtitle = (file.size.integerValue > 0) ? [NSByteCountFormatter stringFromByteCount:file.size.longLongValue countStyle:NSByteCountFormatterCountStyleFile] : @"";
self.thumbnailImage = [UIImage imageNamed:@"folder"];
} else
self.thumbnailImage = [UIImage imageNamed:@"blank"];
}
self.title = dropboxFile.name;
}
}
- (void)_updateBoxRepresentation:(BoxItem *)boxFile
......
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