|
|
@@ -12,7 +12,7 @@
|
|
|
|
|
|
#import "CSTabBarController.h"
|
|
|
|
|
|
-//#import "NewMessageTransController.h"
|
|
|
+#import "NewMessageTransController.h"
|
|
|
|
|
|
#import "CSFileDownUpCell.h"
|
|
|
|
|
|
@@ -145,6 +145,7 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
|
|
|
//待取消.使用reload并判断文件状态,是否需要移动.
|
|
|
[self initData];
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -152,6 +153,9 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
{
|
|
|
[super viewWillAppear:animated];
|
|
|
|
|
|
+ //需要重新注册进度block
|
|
|
+ [self.mainTableView reloadData];
|
|
|
+
|
|
|
[self registeUploadCenter];
|
|
|
|
|
|
[self registeDownloadCenter];
|
|
|
@@ -160,9 +164,13 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
[self registerFileFolderDownloadNotoice];
|
|
|
}
|
|
|
|
|
|
+}
|
|
|
|
|
|
- //待取消.使用reload并判断文件状态,是否需要移动.
|
|
|
-// [self initData];
|
|
|
+#warning 2017-08-04 bug之.如果退出进入一个未完成的文件夹,则上层进度不会再通知上上层,导致数据不会刷新.
|
|
|
+- (void)viewWillDisappear:(BOOL)animated
|
|
|
+{
|
|
|
+ [super viewWillDisappear:animated];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)muiltSelect
|
|
|
@@ -263,69 +271,89 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
#warning 2017-06-30 获取doing和waiting的数据,加入center进行任务, pause的手动处理.
|
|
|
- (void)initData
|
|
|
{
|
|
|
- [self.downloadProcessDataArray removeAllObjects];
|
|
|
- [self.downloadFinishDataArray removeAllObjects];
|
|
|
- [self.uploadProcessDataArray removeAllObjects];
|
|
|
- [self.uploadFinishDataArray removeAllObjects];
|
|
|
-
|
|
|
+ [Utils showWaitingToView:self.view];
|
|
|
+
|
|
|
__weak typeof(self)weakSelf = self;
|
|
|
|
|
|
+ __weak typeof(self.view)weakView = self.view;
|
|
|
+
|
|
|
__weak typeof(self.mainTableView)weakTableView = self.mainTableView;
|
|
|
+
|
|
|
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
+
|
|
|
+ [weakSelf.downloadProcessDataArray removeAllObjects];
|
|
|
+ [weakSelf.downloadFinishDataArray removeAllObjects];
|
|
|
+ [weakSelf.uploadProcessDataArray removeAllObjects];
|
|
|
+ [weakSelf.uploadFinishDataArray removeAllObjects];
|
|
|
|
|
|
- [kCloudStorageDB getSubFileFolderUpSuccessFileWithPid:self.pid ResultBlock:^(NSArray *result) {
|
|
|
-
|
|
|
- for (CSFileDownUpModel *csFileDownUpModel in result) {
|
|
|
- CSFileDownUpFrameModel *frameModel = [[CSFileDownUpFrameModel alloc]initWithCSFileDownUpModel:csFileDownUpModel];
|
|
|
- [weakSelf.uploadFinishDataArray addObject:frameModel];
|
|
|
+ [kCloudStorageDB getSubFileFolderUpSuccessFileWithPid:weakSelf.pid ResultBlock:^(NSArray *result) {
|
|
|
|
|
|
- }
|
|
|
+ for (CSFileDownUpModel *csFileDownUpModel in result) {
|
|
|
+ CSFileDownUpFrameModel *frameModel = [[CSFileDownUpFrameModel alloc]initWithCSFileDownUpModel:csFileDownUpModel];
|
|
|
+ [weakSelf.uploadFinishDataArray addObject:frameModel];
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- [weakTableView reloadData];
|
|
|
- }];
|
|
|
-
|
|
|
-#warning list根据cagegory =0 及 pid来.首次如果pid不存在, 则使用cagegory =0 , 然后点击后,pid赋值..
|
|
|
- [kCloudStorageDB getSubFileFolderUpUnFinishedFileWithPid:self.pid ResultBlock:^(NSArray *result) {
|
|
|
+ }];
|
|
|
|
|
|
- for (CSFileDownUpModel *csFileDownUpModel in result) {
|
|
|
+ [kCloudStorageDB getSubFileFolderUpUnFinishedFileWithPid:weakSelf.pid ResultBlock:^(NSArray *result) {
|
|
|
|
|
|
- CSFileDownUpFrameModel *frameModel = [[CSFileDownUpFrameModel alloc]initWithCSFileDownUpModel:csFileDownUpModel];
|
|
|
- [weakSelf.uploadProcessDataArray addObject:frameModel];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- [weakTableView reloadData];
|
|
|
- }];
|
|
|
-
|
|
|
-
|
|
|
- //下载成功的条件: 符合条件pid的文件,以及文件夹且子文件都成功.
|
|
|
+ for (CSFileDownUpModel *csFileDownUpModel in result) {
|
|
|
+
|
|
|
+ CSFileDownUpFrameModel *frameModel = [[CSFileDownUpFrameModel alloc]initWithCSFileDownUpModel:csFileDownUpModel];
|
|
|
+ [weakSelf.uploadProcessDataArray addObject:frameModel];
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- [kCloudStorageDB getSubFileFolderDownSuccessFileWithPid:self.pid ResultBlock:^(NSArray *result) {
|
|
|
-
|
|
|
- for (CSFileDownUpModel *csFileDownUpModel in result) {
|
|
|
- CSFileDownUpFrameModel *frameModel = [[CSFileDownUpFrameModel alloc]initWithCSFileDownUpModel:csFileDownUpModel];
|
|
|
- [weakSelf.downloadFinishDataArray addObject:frameModel];
|
|
|
+ }];
|
|
|
+
|
|
|
+ //下载成功的条件: 符合条件pid的文件,以及文件夹且子文件都成功.
|
|
|
+
|
|
|
+ NSLog(@"Finished递归start-ge");
|
|
|
+ [kCloudStorageDB getSubFileFolderDownSuccessFileWithPid:weakSelf.pid ResultBlock:^(NSArray *result) {
|
|
|
+ NSLog(@"Finished递归end-ge,result数量%ld",result.count);
|
|
|
+ for (CSFileDownUpModel *csFileDownUpModel in result) {
|
|
|
+ CSFileDownUpFrameModel *frameModel = [[CSFileDownUpFrameModel alloc]initWithCSFileDownUpModel:csFileDownUpModel];
|
|
|
+ [weakSelf.downloadFinishDataArray addObject:frameModel];
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ }];
|
|
|
|
|
|
- [weakTableView reloadData];
|
|
|
- }];
|
|
|
-
|
|
|
- //文件夹单独放出来进行判断.
|
|
|
-
|
|
|
- [kCloudStorageDB getSubFileFolderDownUnFinishedFileWithPid:self.pid ResultBlock:^(NSArray *result) {
|
|
|
+ //文件夹单独放出来进行判断.
|
|
|
+ NSLog(@"UnFinished递归start-ge");
|
|
|
|
|
|
- for (CSFileDownUpModel *csFileDownUpModel in result) {
|
|
|
+ [kCloudStorageDB getSubFileFolderDownUnFinishedFileWithPid:weakSelf.pid ResultBlock:^(NSArray *result) {
|
|
|
+ NSLog(@"UnFinished递归end-ge,result数量%ld",result.count);
|
|
|
|
|
|
- CSFileDownUpFrameModel *frameModel = [[CSFileDownUpFrameModel alloc]initWithCSFileDownUpModel:csFileDownUpModel];
|
|
|
|
|
|
- [weakSelf.downloadProcessDataArray addObject:frameModel];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- [weakTableView reloadData];
|
|
|
- }];
|
|
|
+ for (CSFileDownUpModel *csFileDownUpModel in result) {
|
|
|
+
|
|
|
+ CSFileDownUpFrameModel *frameModel = [[CSFileDownUpFrameModel alloc]initWithCSFileDownUpModel:csFileDownUpModel];
|
|
|
+
|
|
|
+ [weakSelf.downloadProcessDataArray addObject:frameModel];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //内涵尺寸计算,数据多2000+耗时6s,分批加载.
|
|
|
+ NSLog(@"多framemode生成效率");
|
|
|
+
|
|
|
+ }];
|
|
|
+
|
|
|
+ NSLog(@"结束");
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+
|
|
|
+ [Utils HiddenWaitingToView:weakView];
|
|
|
+
|
|
|
+ [weakTableView reloadData];
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -356,7 +384,8 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
|
- [weakTableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
+ [weakTableView reloadData];
|
|
|
+// [weakTableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
});
|
|
|
|
|
|
}
|
|
|
@@ -395,7 +424,10 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
NSInteger index = [weakself.downloadProcessDataArray indexOfObject:downloaddingFrameModel];
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
- [weakTableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
+
|
|
|
+ [weakTableView reloadData];
|
|
|
+
|
|
|
+// [weakTableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
|
|
|
});
|
|
|
|
|
|
@@ -424,8 +456,8 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
|
-// [weakTableView reloadData];
|
|
|
- [weakTableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
+ [weakTableView reloadData];
|
|
|
+// [weakTableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
|
|
|
});
|
|
|
|
|
|
@@ -447,14 +479,14 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
- (void)registerFileFolderDownloadNotoice
|
|
|
{
|
|
|
__weak typeof(self)weakSelf = self;
|
|
|
+ __weak typeof(self.mainTableView)weakTableView = self.mainTableView;
|
|
|
//新增文件夹下载
|
|
|
CSTabBarController *tabBarController = (CSTabBarController *)self.tabBarController;
|
|
|
|
|
|
tabBarController.cloudControlerFileDownloadBlock = ^(NSArray *dbModels){
|
|
|
|
|
|
|
|
|
- [weakSelf initData];
|
|
|
-#warning 2017-08-01 待完善.以及后续主动更新
|
|
|
+ [weakSelf initData];
|
|
|
|
|
|
};
|
|
|
|
|
|
@@ -538,9 +570,18 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
|
|
|
csFileDownUpFrameModel.csFileDownUpModel.downUpStatus = downUpStatus;
|
|
|
|
|
|
+ NSInteger index = [weakself.processDataArray indexOfObject:csFileDownUpFrameModel];
|
|
|
+
|
|
|
+ NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
|
|
|
+
|
|
|
+ [weakTableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
+
|
|
|
+ [weakTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionNone animated:YES];
|
|
|
+
|
|
|
//db save
|
|
|
[kCloudStorageDB updateCSDownUpFileStatusWithCSFileDownUpModel:csFileDownUpFrameModel.csFileDownUpModel];
|
|
|
|
|
|
+
|
|
|
//center notice.
|
|
|
if (!csFileDownUpFrameModel.csFileDownUpModel.isdir) {
|
|
|
|
|
|
@@ -554,9 +595,7 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
}
|
|
|
|
|
|
//如果上层文件夹下所有文件都暂停,则上层文件夹状态也为暂停,反之如果文件夹初始暂停,其中某个文件开始,则设置文件夹状态为doing.
|
|
|
- //取消判断,数据库viewwillapper时会判断.
|
|
|
-#warning 2017-08-02 bug 之:如果此时刷新,则会将同一model当前cell的block重新被父cell下的model抢注册。导致首个回调不体现。解决思路:通知上层只刷新ui,不注册block?
|
|
|
-
|
|
|
+
|
|
|
if (weakself.parentFileResponseSubFilesBlock) {
|
|
|
weakself.parentFileResponseSubFilesBlock(@[csFileDownUpFrameModel.csFileDownUpModel],weakself.parentCSFileDownUpModel,downUpStatus);
|
|
|
}
|
|
|
@@ -571,10 +610,6 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
|
|
|
csFileDownUpModel.downUpStatus = csFileDownUpFrameModel.csFileDownUpModel.downUpStatus;
|
|
|
|
|
|
- //移至cengter
|
|
|
-// [kCloudStorageDB updateCSDownUpFileStatusWithCSFileDownUpModel:csFileDownUpModel];
|
|
|
- //需要先判断是否有同文件在进行,如果有,移除文件夹的callblock.
|
|
|
-
|
|
|
if (!csFileDownUpModel.isdir && (csFileDownUpModel.downUpStatus != DownUpStatusSuccess )) {
|
|
|
|
|
|
[tempArray addObject:csFileDownUpModel];
|
|
|
@@ -593,27 +628,15 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
weakself.parentFileResponseSubFilesBlock(tempArray,weakself.parentCSFileDownUpModel,downUpStatus);
|
|
|
}
|
|
|
|
|
|
- //DB 或者 http 获取所有文件夹下的文件
|
|
|
-
|
|
|
- //这里还是需要获取所有文件信息,需要批量操作上传下载.
|
|
|
}
|
|
|
|
|
|
- NSInteger index = [weakself.processDataArray indexOfObject:csFileDownUpFrameModel];
|
|
|
-
|
|
|
- NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
|
|
|
-
|
|
|
- [weakTableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
-
|
|
|
- [weakTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionNone animated:YES];
|
|
|
+
|
|
|
};
|
|
|
|
|
|
-#warning 2017-07-26 待修改为start next先,再1s后success first.
|
|
|
+
|
|
|
csFileDownUpCell.fileDownUpSuccessBlock = ^(CSFileDownUpFrameModel *downUpFrameModel){
|
|
|
|
|
|
- if (weakself.parentFileResponseSubFilesBlock) {
|
|
|
- weakself.parentFileResponseSubFilesBlock(@[downUpFrameModel.csFileDownUpModel],weakself.parentCSFileDownUpModel,DownUpStatusSuccess);
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
NSInteger index = 0;
|
|
|
|
|
|
if (downUpFrameModel.csFileDownUpModel.downUpType == DownUpModelUp) {
|
|
|
@@ -635,17 +658,20 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
|
|
|
//or 先next再sucess.
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-#warning section header不刷新,以及小文件成功的刷新不及时
|
|
|
-#warning willwillappear 刷新数据优化.
|
|
|
+
|
|
|
if (downUpFrameModel.csFileDownUpModel.downUpType == weakself.downUpModel) {
|
|
|
- [weakTableView reloadData];
|
|
|
-// [weakTableView moveRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] toIndexPath:[NSIndexPath indexPathForRow:0 inSection:1]];//无法更新num.
|
|
|
-//
|
|
|
-// [weakTableView reloadSectionIndexTitles];
|
|
|
|
|
|
+ [weakTableView reloadData];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
});
|
|
|
+#warning 2017-08-04
|
|
|
+ //等到文件夹成功不可取.(需每个成功,时时更新,解决方案:控制器block,(另开方法)注册down/up,center,每个success的block回调,遍历isdir/md5 file 进行判断.)
|
|
|
+ if (weakself.parentFileResponseSubFilesBlock) {
|
|
|
+ weakself.parentFileResponseSubFilesBlock(!downUpFrameModel.csFileDownUpModel.isdir?@[downUpFrameModel.csFileDownUpModel]:downUpFrameModel.csFileDownUpModel.subFileDownUpModels ,weakself.parentCSFileDownUpModel,DownUpStatusSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
};
|
|
|
//
|
|
|
@@ -899,18 +925,18 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
|
|
|
- (void)shareFiles:(NSArray<CSFileDownUpFrameModel*> *)files
|
|
|
{
|
|
|
-// __block NSMutableArray *tempArray = [NSMutableArray array];
|
|
|
-//
|
|
|
-// [files enumerateObjectsUsingBlock:^(CSFileDownUpFrameModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
|
-// [tempArray addObject:obj.csFileDownUpModel];
|
|
|
-// }];
|
|
|
-//
|
|
|
-// NewMessageTransController *tanrsController = [NewMessageTransController new];
|
|
|
-// tanrsController.csfilesArray = tempArray;
|
|
|
-// tanrsController.isDisableMulitselect = YES;
|
|
|
-// IWNavigationController *navCor = [[IWNavigationController alloc]initWithRootViewController:tanrsController];
|
|
|
-//
|
|
|
-// [self.navigationController presentViewController:navCor animated:YES completion:nil];
|
|
|
+ __block NSMutableArray *tempArray = [NSMutableArray array];
|
|
|
+
|
|
|
+ [files enumerateObjectsUsingBlock:^(CSFileDownUpFrameModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
|
+ [tempArray addObject:obj.csFileDownUpModel];
|
|
|
+ }];
|
|
|
+
|
|
|
+ NewMessageTransController *tanrsController = [NewMessageTransController new];
|
|
|
+ tanrsController.csfilesArray = tempArray;
|
|
|
+ tanrsController.isDisableMulitselect = YES;
|
|
|
+ IWNavigationController *navCor = [[IWNavigationController alloc]initWithRootViewController:tanrsController];
|
|
|
+
|
|
|
+ [self.navigationController presentViewController:navCor animated:YES completion:nil];
|
|
|
}
|
|
|
|
|
|
- (void)shareFile:(CSFileDownUpFrameModel *)file
|
|
|
@@ -926,15 +952,12 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
*/
|
|
|
- (void)subFileOperateWithSubFiles:(NSArray *)subFiles parentFolderFileModel:(CSFileDownUpModel *)parentFileDownUpModel downUpStutas:(DownUpStatus)downUpStatus
|
|
|
{
|
|
|
-
|
|
|
__weak typeof(self)weakSelf = self;
|
|
|
|
|
|
- __weak typeof(self.mainTableView)weakTableView = self.mainTableView;
|
|
|
-
|
|
|
-#warning 2017-08-02 bug之首次点击二级页面未注册process - block.
|
|
|
//先修改文件夹状态.
|
|
|
NSArray *targetFileFolder = [weakSelf.downloadProcessDataArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"csFileDownUpModel.downUpUUID = %@",parentFileDownUpModel.downUpUUID]];
|
|
|
-
|
|
|
+ //暂时不考虑同级下的文件
|
|
|
+// NSArray *targetSameFiles = [weakSelf.downloadProcessDataArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"csFileDownUpModel.md5 = %@ and csFileDownUpModel.name = %@",selfFileDownUpModel.md5,selfFileDownUpModel.name]];//获取取消父节点?for递归文件夹subfiles及文件.
|
|
|
if (targetFileFolder.count) {
|
|
|
|
|
|
CSFileDownUpFrameModel *folerFileDownUpFrameModel = targetFileFolder[0];
|
|
|
@@ -954,22 +977,14 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
|
|
|
if (newFolderStatus != folerFileDownUpFrameModel.csFileDownUpModel.downUpStatus) {
|
|
|
|
|
|
+ folerFileDownUpFrameModel.csFileDownUpModel.downUpStatus = newFolderStatus;
|
|
|
+
|
|
|
if (newFolderStatus == DownUpStatusSuccess) {
|
|
|
|
|
|
[weakSelf.downloadProcessDataArray removeObject:folerFileDownUpFrameModel];
|
|
|
|
|
|
- [weakSelf.downloadFinishDataArray addObject:folerFileDownUpFrameModel];
|
|
|
+ [weakSelf.downloadFinishDataArray insertObject:folerFileDownUpFrameModel atIndex:0];
|
|
|
|
|
|
- [weakTableView reloadData];
|
|
|
-
|
|
|
- }else{
|
|
|
- folerFileDownUpFrameModel.csFileDownUpModel.downUpStatus = newFolderStatus;
|
|
|
-
|
|
|
- NSInteger index = [weakSelf.downloadProcessDataArray indexOfObject:folerFileDownUpFrameModel];
|
|
|
-
|
|
|
- dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
- [weakTableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
|
|
|
- });
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -978,78 +993,6 @@ typedef void (^ParentFileResponseSubFilesBlock)(NSArray <CSFileDownUpModel *> *s
|
|
|
}
|
|
|
|
|
|
|
|
|
- //如果成功,需要移动.
|
|
|
-// if (downUpStatus == DownUpStatusSuccess) {
|
|
|
-//
|
|
|
-//
|
|
|
-// CSFileDownUpModel *selfFileDownUpModel = subFiles[0];
|
|
|
-//
|
|
|
-// //同理,暂停,开始,都可以.
|
|
|
-// NSMutableArray *needMoveframeModels = [NSMutableArray array];
|
|
|
-// NSMutableArray *needMoveIndexs = [NSMutableArray array];
|
|
|
-//
|
|
|
-// NSArray *targetFileFolder = [weakSelf.downloadProcessDataArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"csFileDownUpModel.downUpUUID = %@",parentFileDownUpModel.downUpUUID]];
|
|
|
-//
|
|
|
-// NSArray *targetSameFiles = [weakSelf.downloadProcessDataArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"csFileDownUpModel.md5 = %@ and csFileDownUpModel.name = %@",selfFileDownUpModel.md5,selfFileDownUpModel.name]];//获取取消父节点?for递归文件夹subfiles及文件.
|
|
|
-//
|
|
|
-// if (targetFileFolder.count) {
|
|
|
-//
|
|
|
-// CSFileDownUpFrameModel *folerFileDownUpFrameModel = targetFileFolder[0];
|
|
|
-// folerFileDownUpFrameModel.csFileDownUpModel.downUpStatus = DownUpStatusDoing;
|
|
|
-// NSArray *targetParentFolderFiles = [folerFileDownUpFrameModel.csFileDownUpModel.subFileDownUpModels filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"md5 = %@ and name = %@",selfFileDownUpModel.md5,selfFileDownUpModel.name]];
|
|
|
-// for (CSFileDownUpModel *subFilesInFolder in targetParentFolderFiles) {
|
|
|
-// subFilesInFolder.downUpStatus = selfFileDownUpModel.downUpStatus;
|
|
|
-// subFilesInFolder.downUpSize = selfFileDownUpModel.downUpSize;
|
|
|
-// }
|
|
|
-//
|
|
|
-// if([weakSelf judgeFileFolderStatusWithFileFolderModel:folerFileDownUpFrameModel.csFileDownUpModel] == DownUpStatusSuccess){
|
|
|
-//
|
|
|
-// folerFileDownUpFrameModel.csFileDownUpModel.downUpStatus = DownUpStatusSuccess;
|
|
|
-//
|
|
|
-// [needMoveframeModels addObject:folerFileDownUpFrameModel];
|
|
|
-//
|
|
|
-// NSInteger index = [weakSelf.downloadProcessDataArray indexOfObject:folerFileDownUpFrameModel];
|
|
|
-//
|
|
|
-// [needMoveIndexs addObject:[NSIndexPath indexPathForRow:index inSection:0]];
|
|
|
-// }
|
|
|
-//
|
|
|
-// //修改targetSubFolderFiles状态
|
|
|
-// //判断subs是否都成功,如果成功,则修改folerFileDownUpModel位置.
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (targetSameFiles.count) {
|
|
|
-//
|
|
|
-// for (CSFileDownUpFrameModel *csFileDownUpFrameModel in targetSameFiles) {
|
|
|
-// csFileDownUpFrameModel.csFileDownUpModel.downUpStatus = selfFileDownUpModel.downUpStatus;
|
|
|
-// csFileDownUpFrameModel.csFileDownUpModel.downUpSize = selfFileDownUpModel.downUpSize;
|
|
|
-//
|
|
|
-// [needMoveframeModels addObjectsFromArray:targetSameFiles];
|
|
|
-//
|
|
|
-// NSInteger index = [weakSelf.downloadProcessDataArray indexOfObject:csFileDownUpFrameModel];
|
|
|
-//
|
|
|
-// [needMoveIndexs addObject:[NSIndexPath indexPathForRow:index inSection:0]];
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// if (needMoveframeModels.count) {
|
|
|
-//
|
|
|
-// [weakSelf.downloadProcessDataArray removeObjectsInArray:needMoveframeModels];
|
|
|
-//
|
|
|
-// [weakSelf.downloadFinishDataArray addObjectsFromArray:needMoveframeModels];
|
|
|
-//
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
-// [weakSelf.mainTableView reloadData];
|
|
|
-// });
|
|
|
-//
|
|
|
-// // [weakSelf.mainTableView deleteRowsAtIndexPaths:needMoveIndexs withRowAnimation:UITableViewRowAnimationNone];
|
|
|
-// // weakSelf.mainTableView i
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-
|
|
|
//递归.
|
|
|
if (weakSelf.parentFileResponseSubFilesBlock) {
|
|
|
weakSelf.parentFileResponseSubFilesBlock(subFiles,weakSelf.parentCSFileDownUpModel,downUpStatus);
|