|
|
@@ -100,6 +100,7 @@ import { SongType } from '../common/enums/SongType';
|
|
|
import { WebdavManager, WebDavAuthInfo as WebDavManagerAuthInfo,
|
|
|
buildHttpHeadersWithWebDav,
|
|
|
WebDavAuthItem} from '../common/util/WebdavManager';
|
|
|
+import PermissionUtil from '../common/util/PermissionUtil'
|
|
|
const TAG = 'LocalMusic';
|
|
|
|
|
|
/**
|
|
|
@@ -6003,11 +6004,14 @@ export struct LocalMusic {
|
|
|
ToastUtil.showToast('标题不能为空')
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ DialogHelper.showLoadingDialog()
|
|
|
+ await PermissionUtil.activatePermission(item.filePath)
|
|
|
+ const tempOutPath = this.currentPath + '/' + item.fileName
|
|
|
+ console.info('onecold tempOutPath ='+tempOutPath)
|
|
|
//用户更改了封面,那就内嵌下封面
|
|
|
if(StrUtil.isNotEmpty(this.imagePathStr)){
|
|
|
const resultCover:boolean = await changeMusicCover(this.context,
|
|
|
- item.filePath,this.imagePathStr,true);
|
|
|
+ item.filePath,this.imagePathStr,true,tempOutPath);
|
|
|
this.imagePathStr = ''
|
|
|
if(resultCover){
|
|
|
ToastUtil.showToast('内嵌封面成功')
|
|
|
@@ -6036,7 +6040,8 @@ export struct LocalMusic {
|
|
|
item.filePath,
|
|
|
this.lyricConStr,
|
|
|
metadata,
|
|
|
- true
|
|
|
+ true,
|
|
|
+ tempOutPath
|
|
|
);
|
|
|
|
|
|
if (result) {
|
|
|
@@ -6048,6 +6053,8 @@ export struct LocalMusic {
|
|
|
if (success) {
|
|
|
console.log(" onecold 编辑信息成功,数据库已同步");
|
|
|
ToastUtil.showToast('内嵌音乐标签成功')
|
|
|
+ // 关闭进度条
|
|
|
+ DialogHelper.closeLoading();
|
|
|
this.isShowMoreView = false
|
|
|
this.name = this.titleStr
|
|
|
if (item.filePath == this.currentSong?.filePath) {
|
|
|
@@ -6079,6 +6086,8 @@ export struct LocalMusic {
|
|
|
|
|
|
|
|
|
} else {
|
|
|
+ // 关闭进度条
|
|
|
+ DialogHelper.closeLoading();
|
|
|
ToastUtil.showToast('内嵌音乐标签失败')
|
|
|
console.log('onecold 内嵌音乐标签失败');
|
|
|
}
|
|
|
@@ -11774,6 +11783,17 @@ export struct LocalMusic {
|
|
|
}
|
|
|
|
|
|
private async play(url: string,startOffset?:number) {
|
|
|
+ console.info('onecold this.url 1= '+url)
|
|
|
+ let hasPermission = await PermissionUtil.activatePermission(url)
|
|
|
+ console.info('onecold this.hasPermission 1= '+hasPermission)
|
|
|
+ if(!url.includes(this.packName)){
|
|
|
+ const file = fs.openSync(url)
|
|
|
+ this.videoUrl = file.path
|
|
|
+ url= this.videoUrl
|
|
|
+ }
|
|
|
+ console.info('onecold this.hasPermission 1= '+hasPermission)
|
|
|
+ console.info('onecold this.videoUrl 1= '+this.videoUrl)
|
|
|
+
|
|
|
let that = this;
|
|
|
that.showLoadIng();
|
|
|
this.isOpenAB = false
|