|
|
@@ -1240,7 +1240,7 @@ export struct LocalMusic {
|
|
|
Logger.info('onecold cachedValue = ' + cachedValue)
|
|
|
const cachedHash = this.findStringCache(curPath + '_hash');
|
|
|
const cachedDirList = this.findCache(curPath + "_dirList");
|
|
|
- if (cachedValue !== undefined) {
|
|
|
+ if (cachedValue !== undefined&&!this.isRefreshing) {
|
|
|
// this.videoLocalList = cachedValue;
|
|
|
Logger.info('onecold 有缓存 cachedValue = ' + cachedValue)
|
|
|
if (this.currentPath != this.rootPath) { //第一个封面赋值给currentTitleCover
|
|
|
@@ -1338,7 +1338,7 @@ export struct LocalMusic {
|
|
|
// this.setButtonStatus()
|
|
|
this.openMusic(isOpen, destPath)
|
|
|
|
|
|
-
|
|
|
+ this.isRefreshing = false
|
|
|
|
|
|
});
|
|
|
|
|
|
@@ -2716,6 +2716,7 @@ export struct LocalMusic {
|
|
|
this.isEditAudio = !this.isEditAudio
|
|
|
this.longItemFilePath = ''
|
|
|
this.modeType = 0
|
|
|
+ this.isShowFileName = true
|
|
|
this.getSortedFiles(FileUtil.getParentPath(outPutPath))
|
|
|
},
|
|
|
onPlayOrPause:()=>{
|
|
|
@@ -2789,6 +2790,7 @@ export struct LocalMusic {
|
|
|
this.isConverter = !this.isConverter
|
|
|
this.longItemFilePath = ''
|
|
|
this.modeType = 0
|
|
|
+ this.isShowFileName = true
|
|
|
this.getSortedFiles(FileUtil.getParentPath(outPutPath))
|
|
|
},
|
|
|
onSliderChange:(value:number)=>{
|
|
|
@@ -2850,6 +2852,7 @@ export struct LocalMusic {
|
|
|
this.isExtractAcc = !this.isExtractAcc
|
|
|
this.longItemFilePath = ''
|
|
|
this.modeType = 0
|
|
|
+ this.isShowFileName = true
|
|
|
this.getSortedFiles(FileUtil.getParentPath(outPutPath))
|
|
|
},
|
|
|
onSliderChange:(value:number)=>{
|
|
|
@@ -2917,6 +2920,7 @@ export struct LocalMusic {
|
|
|
this.isAIVoiceSeparation = !this.isAIVoiceSeparation
|
|
|
this.longItemFilePath = ''
|
|
|
this.modeType = 0
|
|
|
+ this.isShowFileName = true
|
|
|
this.getSortedFiles(FileUtil.getParentPath(outPutPath))
|
|
|
},
|
|
|
onSliderChange:(value:number)=>{
|
|
|
@@ -2979,6 +2983,7 @@ export struct LocalMusic {
|
|
|
this.isExtractAudio = !this.isExtractAudio
|
|
|
this.longItemFilePath = ''
|
|
|
this.modeType = 0
|
|
|
+ this.isShowFileName = true
|
|
|
this.getSortedFiles(FileUtil.getParentPath(outPutPath))
|
|
|
},
|
|
|
onSliderChange:(value:number)=>{
|
|
|
@@ -3041,6 +3046,7 @@ export struct LocalMusic {
|
|
|
this.isMergeAudio = !this.isMergeAudio
|
|
|
this.longItemFilePath = ''
|
|
|
this.modeType = 0
|
|
|
+ this.isShowFileName = true
|
|
|
this.getSortedFiles(FileUtil.getParentPath(outPutPath))
|
|
|
},
|
|
|
onResult:(result: boolean,outPath:string)=>{
|
|
|
@@ -3489,8 +3495,13 @@ export struct LocalMusic {
|
|
|
|
|
|
}))
|
|
|
.onClick(()=>{
|
|
|
- this.doPlay(item,index)
|
|
|
- this.isShowPlay = true
|
|
|
+ if (this.isMultiSelect) {
|
|
|
+ const isChecked = this.selectedFiles.some(x => x.filePath == item.filePath);
|
|
|
+ this.handleFileSelection(item, !isChecked);
|
|
|
+ } else {
|
|
|
+ this.doPlay(item,index)
|
|
|
+ this.isShowPlay = true
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -5479,9 +5490,6 @@ export struct LocalMusic {
|
|
|
if(this.modeType==0){
|
|
|
this.getSortedFiles(this.currentPath)
|
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
- this.isRefreshing = false;
|
|
|
- }, 100)
|
|
|
}).catch((e:object)=>{
|
|
|
console.info("task1 catch e: " + e);
|
|
|
})
|
|
|
@@ -6505,7 +6513,11 @@ export struct LocalMusic {
|
|
|
}
|
|
|
DialogHelper.showLoadingDialog()
|
|
|
await PermissionUtil.activatePermission(item.filePath)
|
|
|
- const tempOutPath = this.currentPath + '/' + item.fileName
|
|
|
+ let tempOutPath = ''
|
|
|
+ // 如果不是 packName 包下的文件,则直接路径用this.currentPath
|
|
|
+ if(!item.filePath.toLowerCase().includes(this.packName)){
|
|
|
+ tempOutPath = this.currentPath + '/' + item.fileName
|
|
|
+ }
|
|
|
console.info('onecold tempOutPath ='+tempOutPath)
|
|
|
//用户更改了封面,那就内嵌下封面
|
|
|
if(StrUtil.isNotEmpty(this.imagePathStr)){
|
|
|
@@ -6533,10 +6545,15 @@ export struct LocalMusic {
|
|
|
comment:this.commentStr,
|
|
|
disc:this.discStr,
|
|
|
};
|
|
|
-
|
|
|
+ let newInput = item.filePath
|
|
|
+ //内嵌标签歌路径如果不是包含包名,输入newInput要赋值tempOutPath,然后tempOutPath为空
|
|
|
+ if(!item.filePath.toLowerCase().includes(this.packName)){
|
|
|
+ newInput = tempOutPath
|
|
|
+ tempOutPath = ''
|
|
|
+ }
|
|
|
//内嵌下标签的值,设置overwrite为true会直接修改原文件
|
|
|
const result:boolean = await repairAudioMetadata(
|
|
|
- item.filePath,
|
|
|
+ newInput,
|
|
|
this.lyricConStr,
|
|
|
metadata,
|
|
|
true,
|
|
|
@@ -6545,8 +6562,8 @@ export struct LocalMusic {
|
|
|
|
|
|
if (result) {
|
|
|
if(!item.filePath.includes(this.packName)){
|
|
|
- //内嵌成功的歌路径如果不是包含包名,则入库
|
|
|
- let newItem: VideoItem = await Utility.uriGetMusicAssetsFromFile(this.context, tempOutPath,
|
|
|
+ //内嵌成功的歌路径如果不是包含包名,则要入库
|
|
|
+ let newItem: VideoItem = await Utility.uriGetMusicAssetsFromFile(this.context, newInput,
|
|
|
CommonConstants.TYPE_LOCAL, this.autoParseMusicName);
|
|
|
this.table.insert(newItem, (id: number) => {
|
|
|
//加入数据库
|