|
|
@@ -127,6 +127,21 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
|
|
|
taskModel.didBackupsCount = 0;
|
|
|
taskModel.bg_tableName = backups_photos_tableName;
|
|
|
|
|
|
+ //备份路径
|
|
|
+ NSString * backupsDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_backups_default_path)];
|
|
|
+
|
|
|
+ if(!backupsDefaultPath || backupsDefaultPath.length == 0){
|
|
|
+ backupsDefaultPath = Const_default_backups_path;
|
|
|
+ [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_backups_default_path) value:backupsDefaultPath];
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString *lastStr= [backupsDefaultPath substringFromIndex:backupsDefaultPath.length-1];
|
|
|
+ if(![lastStr isEqualToString:@"/"]){
|
|
|
+ backupsDefaultPath = [[NSString alloc] initWithFormat:@"%@/",backupsDefaultPath];
|
|
|
+ }
|
|
|
+
|
|
|
+ taskModel.backupsPath = backupsDefaultPath;
|
|
|
+
|
|
|
NSMutableString *allLocalIdentifier= [NSMutableString new];
|
|
|
|
|
|
for (PHAsset *asset in curAlbumModel.result) {
|
|
|
@@ -140,7 +155,9 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
|
|
|
|
|
|
taskModel.totalLocalIdentifier = allLocalIdentifier;
|
|
|
|
|
|
- if(self->_lastModel && self->_lastModel.totalLocalIdentifier){//相册备份排重
|
|
|
+ if(self->_lastModel
|
|
|
+ && self->_lastModel.totalLocalIdentifier
|
|
|
+ && (self->_lastModel.backupsPath && [self->_lastModel.backupsPath isEqualToString:taskModel.backupsPath])){//相册备份排重
|
|
|
taskModel.curTaskLocalIdentifier = [weakSelf AlbumBackupsHandleNew:taskModel];
|
|
|
}
|
|
|
else{
|
|
|
@@ -463,6 +480,23 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
|
|
|
|
|
|
}
|
|
|
|
|
|
+//文件重新备份
|
|
|
+- (void)reBackupsFileFun
|
|
|
+{
|
|
|
+ [self handlePhotosBackupsFun];
|
|
|
+
|
|
|
+ //if(_curPhotosBackupsTaskMod.curBackupsState != backupsStateUploading)
|
|
|
+ if(self->_lastModel.curBackupsState != backupsStateUploading){
|
|
|
+ if(self->_lastModel.curBackupsState == backupsStateFail
|
|
|
+ ||self->_lastModel.curBackupsState == backupsStateDone){//上次备份完成
|
|
|
+ [self getAllAlbumsFun];
|
|
|
+ }
|
|
|
+ else{//继续上次的备份任务
|
|
|
+ [self handelBackupsModelFun:self->_lastModel];
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//检查是否需要重新备份
|
|
|
- (void)checkReBackupsFileFun
|
|
|
{
|