Browse Source

1.下载多个音乐时丢失一个问题

huangxiaodong 11 months ago
parent
commit
81a151db53

+ 2 - 2
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -5254,7 +5254,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 6;
+				CURRENT_PROJECT_VERSION = 7;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -5335,7 +5335,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 6;
+				CURRENT_PROJECT_VERSION = 7;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (

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

@@ -411,7 +411,7 @@ totalBytesExpectedToSend:(int64_t)totalBytesExpectedToSend {
     
     // 获得已经下载的文件大小
     operation.currentSize += data.length;
-    HLog(@"%@\n currentSize:%lld---progress:%.2f",operation.url, operation.currentSize, 1.00*operation.currentSize/operation.totalSize);
+    HLog(@"currentSize:%lld---progress:%.2f", operation.currentSize, 1.00*operation.currentSize/operation.totalSize);
 
     // 写入文件
     if(operation.handle){

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

@@ -255,6 +255,7 @@
             if (error) {
                 // 读取出错
                 if(self.nasFullPath){
+                    self.nasFullPath = nil;
                     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(20 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                         [self checkSaveNasFileAgainFun];
                     });
@@ -269,6 +270,7 @@
                     //nas下载流程
                     [[NSFileManager defaultManager] removeItemAtPath:self.nasFullPath error:nil];
                     [[boxDownloadFileManager shareInstance] deleteDownloadDonePlistInfoBy:self.nasFullPath];
+                    self.nasFullPath = nil;
                     [self checkSaveNasFileAgainFun];
                 }
                 
@@ -278,6 +280,7 @@
     } else {
         // 授权失败
         if(self.nasFullPath){
+            self.nasFullPath = nil;
             dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(20 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                 [self checkSaveNasFileAgainFun];
             });
@@ -288,7 +291,6 @@
 #pragma mark 再次读取下载完成数据做保存操作
 - (void)checkSaveNasFileAgainFun
 {
-    self.nasFullPath = nil;
     [[boxDownloadFileManager shareInstance] checkDownloadDonePlistInfoFun];
 }
 @end

+ 5 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+downloadNasFile.m

@@ -11,6 +11,11 @@
 #pragma mark 下载完成
 - (void)downloadTaskFinishedNoti:(NSNotification *)notification
 {
+    if(self.nasFullPath && self.nasFullPath.length >0){
+        HLog(@"前面一个保存流程没走完")
+        return;
+    }
+    
     curDownloadmodel = notification.object;
     KWeakSelf
     if (curDownloadmodel.downloadState == customDownloadStateCompleted) {