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