瀏覽代碼

1.视频数据缓存

huangxiaodong 2 月之前
父節點
當前提交
df950fae3d
共有 1 個文件被更改,包括 21 次插入0 次删除
  1. 21 0
      创维盒子/code/NAS/NasPreviewVideoViewController.m

+ 21 - 0
创维盒子/code/NAS/NasPreviewVideoViewController.m

@@ -796,6 +796,14 @@
     [self checkFileTransferTask];
     
     if(!_curNASFileAudioMod){
+        
+        //数据缓存
+        NSString *key = stringKeyAddSn(@"getFileList_video");
+        NSDictionary *DataDict = [HWDataManager getObjectWithKey:key];
+        if(DataDict){
+            _curNASFileAudioMod = [[NASFileAudioModel alloc] initWithDictionary:DataDict error:nil];
+        }
+        
         [self getFileListFun:NO];
         [self queryShareSwitchFunFun];
     }
@@ -928,6 +936,19 @@
         [weakSelf handelNetDataAfterFilterDataBy:NASFileAudioMod];
         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_video");
+            [HWDataManager setObjectWithKey:key value:IdDataDict];
         }
         
     } failure:^(NSError * _Nonnull error) {