|
@@ -37,7 +37,7 @@
|
|
|
#import "NCNetworkingEndToEnd.h"
|
|
|
#import "PKDownloadButton.h"
|
|
|
|
|
|
-@interface CCMain () <CCActionsDeleteDelegate, CCActionsRenameDelegate, CCActionsSearchDelegate, CCActionsDownloadThumbnailDelegate, CCActionsSettingFavoriteDelegate, UITextViewDelegate, createFormUploadAssetsDelegate, MGSwipeTableCellDelegate, CCLoginDelegate, CCLoginDelegateWeb>
|
|
|
+@interface CCMain () <CCActionsDeleteDelegate, CCActionsRenameDelegate, CCActionsSearchDelegate, CCActionsSettingFavoriteDelegate, UITextViewDelegate, createFormUploadAssetsDelegate, MGSwipeTableCellDelegate, CCLoginDelegate, CCLoginDelegateWeb>
|
|
|
{
|
|
|
AppDelegate *appDelegate;
|
|
|
|
|
@@ -1070,26 +1070,17 @@
|
|
|
#pragma mark ==== Download Thumbnail Delegate ====
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
|
|
|
|
-- (void)downloadThumbnailSuccessFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
|
|
|
+- (void)downloadThumbnail:(tableMetadata *)metadata serverUrl:(NSString *)serverUrl indexPath:(NSIndexPath *)indexPath
|
|
|
{
|
|
|
- // Check Active Account
|
|
|
- if (![metadataNet.account isEqualToString:appDelegate.activeAccount])
|
|
|
- return;
|
|
|
+ OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:appDelegate.activeUser withUserID:appDelegate.activeUserID withPassword:appDelegate.activePassword withUrl:appDelegate.activeUrl];
|
|
|
|
|
|
- if (errorCode == 0) {
|
|
|
-
|
|
|
- NSIndexPath *indexPath = [_sectionDataSource.fileIDIndexPath objectForKey:metadataNet.fileID];
|
|
|
+ [ocNetworking downloadThumbnailWithDimOfThumbnail:@"m" fileID:metadata.fileID fileNamePath:[CCUtility returnFileNamePathFromFileName:metadata.fileName serverUrl:serverUrl activeUrl:appDelegate.activeUrl] fileNameView:metadata.fileNameView success:^{
|
|
|
|
|
|
- if ([self indexPathIsValid:indexPath]) {
|
|
|
-
|
|
|
- if ([[NSFileManager defaultManager] fileExistsAtPath:[CCUtility getDirectoryProviderStorageIconFileID:metadataNet.fileID fileNameView:metadataNet.fileNameView]])
|
|
|
- [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- NSLog(@"[LOG] Download Thumbnail Failure error %d, %@", (int)errorCode, message);
|
|
|
- }
|
|
|
+ if ([[NSFileManager defaultManager] fileExistsAtPath:[CCUtility getDirectoryProviderStorageIconFileID:metadata.fileID fileNameView:metadata.fileNameView]])
|
|
|
+ [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
+
|
|
|
+ } failure:^(NSString *message, NSInteger errorCode) {
|
|
|
+ }];
|
|
|
}
|
|
|
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
@@ -4524,7 +4515,7 @@
|
|
|
|
|
|
// Download thumbnail
|
|
|
if (metadata.thumbnailExists && !iconFileExists && !_metadataFolder.e2eEncrypted) {
|
|
|
- [[CCActions sharedInstance] downloadTumbnail:metadata delegate:self];
|
|
|
+ [self downloadThumbnail:metadata serverUrl:serverUrl indexPath:indexPath];
|
|
|
}
|
|
|
|
|
|
// Status Image
|