Bläddra i källkod

1.音频数据缓存

huangxiaodong 2 månader sedan
förälder
incheckning
b64c2af8fc

+ 20 - 0
创维盒子/code/Class/Set/previewFile/previewAudioOrDocumentViewController.m

@@ -816,6 +816,13 @@
     [self checkFileTransferTask];
     
     if(!_curNASFileAudioMod){
+        //数据缓存
+        NSString *key = stringKeyAddSn(@"getFileList_audio");
+        NSDictionary *DataDict = [HWDataManager getObjectWithKey:key];
+        if(DataDict){
+            _curNASFileAudioMod = [[NASFileAudioModel alloc] initWithDictionary:DataDict error:nil];
+        }
+        
         [self getFileListFun:NO];
         [self queryShareSwitchFunFun];
     }
@@ -959,6 +966,19 @@
 
         if(weakSelf.curNASFileAudioMod && weakSelf.curNASFileAudioMod.status == 0){
             [weakSelf.tableView reloadData];
+            
+            NSMutableDictionary *IdDataDict = [[NSMutableDictionary alloc] initWithDictionary:responseObject];
+            
+            for (NSString *key in responseObject) {
+                id object = IdDataDict[key];
+                if(!object || [object isKindOfClass:[NSNull class]]){
+                    [IdDataDict removeObjectForKey:key];
+                }
+            }
+        
+            //数据缓存
+            NSString *key = stringKeyAddSn(@"getFileList_audio");
+            [HWDataManager setObjectWithKey:key value:IdDataDict];
         }
         
     } failure:^(NSError * _Nonnull error) {