Browse Source

1.备份相关优化

huangxiaodong 1 year ago
parent
commit
6929171289

+ 2 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/downLoadFile/downLoadPreviewViewController.m

@@ -272,7 +272,8 @@
     
     [self.tableView reloadData];
     
-    [self gotoDownThumbnailManagerFun];
+    //这个要做判断 不能为空
+    //[self gotoDownThumbnailManagerFun];
 }
 
 

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/backupsFileManager.h

@@ -30,7 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)backupsFileDoneFun;
 
 //修改文件上传的状态
-- (void)changeBackupsFileStateWithSpeedFun;
+- (void)changeBackupsFileStateFun;
 
 - (void)suspendBackupsFileFun;
 //文件重新备份

+ 5 - 5
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/backupsFileManager.m

@@ -161,7 +161,7 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
     {
         _curPhotosBackupsTaskMod.curBackupsState = backupsStateDone;
         [self RefreshDatabaseFun];
-        [self changeBackupsFileStateWithSpeedFun];
+        [self changeBackupsFileStateFun];
         return;
     }
     
@@ -177,7 +177,7 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
     if(index >= _curPhotosBackupsTaskMod.LocalIdentifierArr.count){
         _curPhotosBackupsTaskMod.curBackupsState = backupsStateDone;
         [self RefreshDatabaseFun];
-        [self changeBackupsFileStateWithSpeedFun];
+        [self changeBackupsFileStateFun];
         _curPhotosBackupsTaskMod = nil;
         return;
     }
@@ -289,7 +289,7 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
     [self deleteVideoFun];
     _curPhotosBackupsTaskMod.didBackupsCount += 1;
     [self RefreshDatabaseFun];
-    [self changeBackupsFileStateWithSpeedFun];
+    [self changeBackupsFileStateFun];
     
     if(_curPhotosBackupsTaskMod.curBackupsState == backupsStateSuspend){
         return;
@@ -300,7 +300,7 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
 }
 
 //修改文件上传的状态
-- (void)changeBackupsFileStateWithSpeedFun
+- (void)changeBackupsFileStateFun
 {
     self.taskRenewTime = [iTools getNowTimeStamp];
     
@@ -318,7 +318,7 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
     
     [_curPhotosBackupsTaskMod bg_saveOrUpdateAsync:^(BOOL isSuccess) {
         if(isSuccess){
-            [self changeBackupsFileStateWithSpeedFun];
+            [self changeBackupsFileStateFun];
         }
     }];
     

+ 4 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/downloadManager.m

@@ -216,9 +216,13 @@ static downloadManager * cur_downloadManager = nil;
     
     if(_curDownloadFileModel.curDownloadStateType == downloadStateDone){
         [_downLoadFileModelDataArr removeObject:_curDownloadFileModel];
+        [self handleDatabaseArrDeleteObjectInDownloading:_curDownloadFileModel];
+        
         [self handleDatabaseArrAddObjectInDone:_curDownloadFileModel];
     }
     else if(_curDownloadFileModel.curDownloadStateType == uploadStateFail){
+        [_downLoadFileModelDataArr removeObject:_curDownloadFileModel];
+        
         [self handleDatabaseArrDeleteObjectInDownloading:_curDownloadFileModel];
         [self handleDatabaseArrAddObjectInFail:_curDownloadFileModel];
     }

+ 5 - 2
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/uploadFileManager.m

@@ -242,7 +242,8 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
     }
     else
     {
-        _curUploadFileDataModel = _fileModelDataArr.firstObject;
+        //_curUploadFileDataModel = _fileModelDataArr.firstObject;
+        _curUploadFileDataModel = _fileModelDataArr.lastObject;
     }
     
     
@@ -526,7 +527,9 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
     
     _reUploadIngSelectIndex = 0;
     
-    for (uploadFileDataModel*addModel in Arr) {
+    NSMutableArray *curArr = [NSMutableArray arrayWithArray:Arr];
+    
+    for (uploadFileDataModel*addModel in curArr) {
         
         BOOL needAddModel = YES;
         

+ 3 - 3
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+backupsFile.m

@@ -58,7 +58,7 @@
     }
     
     NSString *lastStr= [backupsDefaultPath substringFromIndex:backupsDefaultPath.length-1];
-    if([lastStr isEqualToString:@"/"]){
+    if(![lastStr isEqualToString:@"/"]){
         backupsDefaultPath = [[NSString alloc] initWithFormat:@"%@/",backupsDefaultPath];
     }
    
@@ -293,7 +293,7 @@
         if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWWAN){
             self.curPhotosBackupsTaskMod.isBackupsSuspendType = backupsSuspendByOther;
             self.curPhotosBackupsTaskMod.curBackupsState = backupsStateSuspend;
-            [[backupsFileManager shareInstance] changeBackupsFileStateWithSpeedFun];
+            [[backupsFileManager shareInstance] changeBackupsFileStateFun];
         }
 
     }
@@ -304,7 +304,7 @@
         return;
     }
     
-    [[backupsFileManager shareInstance] changeBackupsFileStateWithSpeedFun];
+    [[backupsFileManager shareInstance] changeBackupsFileStateFun];
     
     if(self.backupsIndexOfUploadFlie < self.backupsCutFileDataArr.count -1) {