|
|
@@ -248,10 +248,24 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //NSString *curFilePath = preDownloadModel.localPath;
|
|
|
+ NSString *curFilePath = [[audioPlayListManager shareManager] getAudioCacheFullPathBy:preDownloadModel.name];
|
|
|
+
|
|
|
// 创建NSFileManager实例
|
|
|
NSFileManager *fileManager = [NSFileManager defaultManager];
|
|
|
+
|
|
|
// 使用fileExistsAtPath方法检查文件是否存在
|
|
|
- BOOL fileExists = [fileManager fileExistsAtPath:preDownloadModel.localPath];
|
|
|
+ BOOL fileExists = [fileManager fileExistsAtPath:curFilePath];
|
|
|
+
|
|
|
+ // 再加一层判断看看
|
|
|
+ if(!fileExists){
|
|
|
+ NSDictionary *attributes = [fileManager attributesOfItemAtPath:curFilePath error:nil];
|
|
|
+ if (attributes) {
|
|
|
+ fileExists = YES;;
|
|
|
+ } else {
|
|
|
+ HLog(@"文件不存在:%@",filePath);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
if(preDownloadModel && preDownloadModel.isDownDoneType && fileExists){
|
|
|
@@ -316,14 +330,16 @@
|
|
|
if([model.path isEqualToString:filePath]){
|
|
|
if (model.isDownDoneType) {
|
|
|
if(model.localPath){
|
|
|
+ NSString *curFilePath = [[audioPlayListManager shareManager] getAudioCacheFullPathBy:model.name];
|
|
|
+
|
|
|
// 创建NSFileManager实例
|
|
|
NSFileManager *fileManager = [NSFileManager defaultManager];
|
|
|
|
|
|
// 使用fileExistsAtPath方法检查文件是否存在
|
|
|
- BOOL fileExists = [fileManager fileExistsAtPath:model.localPath];
|
|
|
+ BOOL fileExists = [fileManager fileExistsAtPath:curFilePath];
|
|
|
|
|
|
if (fileExists) {
|
|
|
- return model.localPath;
|
|
|
+ return curFilePath;
|
|
|
} else {
|
|
|
return @"";
|
|
|
}
|