Marino Faggiana 6 жил өмнө
parent
commit
cbd7b82671

+ 7 - 7
iOSClient/Networking/OCNetworking.m

@@ -330,18 +330,18 @@
 {
     NSString *fileNameViewPath = [NSString stringWithFormat:@"%@/%@", [CCUtility getDirectoryProviderStorageFileID:fileID], fileName];
     
-    if ([[NSFileManager defaultManager] fileExistsAtPath:fileNameViewPath]) {
-        
-        completion(nil, 0);
-        
-    } else {
+//    if ([[NSFileManager defaultManager] fileExistsAtPath:fileNameViewPath]) {
+    
+//        completion(nil, 0);
+    
+//    } else {
     
         OCCommunication *communication = [CCNetworking sharedNetworking].sharedOCCommunication;
 
         [communication setCredentialsWithUser:_activeUser andUserID:_activeUserID andPassword:_activePassword];
         [communication setUserAgent:[CCUtility getUserAgent]];
         
-        [communication getRemotePreviewByServer:[_activeUrl stringByAppendingString:@"/"] ofFileID:fileID withWidth:width andHeight:height andA:a andMode:mode onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSData *preview, NSString *redirectedServer) {
+        [communication getRemotePreviewByServer:_activeUrl ofFileID:fileID withWidth:width andHeight:height andA:a andMode:mode onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSData *preview, NSString *redirectedServer) {
 
             [UIImagePNGRepresentation([UIImage imageWithData:preview]) writeToFile:fileNameViewPath atomically: YES];
             
@@ -363,7 +363,7 @@
             
             completion(message, errorCode);
         }];
-    }
+//    }
 }
 
 

+ 7 - 0
iOSClient/PeekPop/CCPeekPop.m

@@ -102,6 +102,12 @@
 - (void)downloadThumbnail
 {
     OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:appDelegate.activeUser withUserID:appDelegate.activeUserID withPassword:appDelegate.activePassword withUrl:appDelegate.activeUrl];
+    
+    [ocNetworking downloadPreviewWithfileID:_metadata.fileID fileName:_metadata.fileNameView withWidth:640 andHeight:480 andA:1 andMode:@"cover" completion:^(NSString *message, NSInteger errorCode) {
+//
+    }];
+    
+    /*
     [ocNetworking downloadThumbnailWithDimOfThumbnail:@"l" fileID:_metadata.fileID fileNamePath:[CCUtility returnFileNamePathFromFileName:_metadata.fileName serverUrl:appDelegate.activeMain.serverUrl activeUrl:appDelegate.activeUrl] fileNameView:_metadata.fileNameView completion:^(NSString *message, NSInteger errorCode) {
         if (errorCode == 0) {
             UIImage *image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.pvw", [CCUtility getDirectoryProviderStorageFileID:_metadata.fileID], _metadata.fileNameView]];
@@ -115,6 +121,7 @@
             [self dismissViewControllerAnimated:YES completion:nil];
         }
     }];
+    */
 }
 
 @end