|
|
@@ -46,7 +46,7 @@ import { ColorConversion } from '../common/util/ColorConversion';
|
|
|
import { LyricController, LyricParser, LyricView2 } from '@seagazer/cclyric';
|
|
|
import { AvSessionController } from '../controller/AvSessionController';
|
|
|
import { repairAudioMetadata, convertDsfToWav, getApiLyric,changeMusicCover} from '../common/util/MusicTagUtils';
|
|
|
-import { FFMpegTags,Utility } from '../common/util/Utility';
|
|
|
+import { extractHwMediaMetadata, FFMpegTags,Utility } from '../common/util/Utility';
|
|
|
import { TagsContentCover } from '../view/TagsContentCover';
|
|
|
import {
|
|
|
// DeviceChangeReason,
|
|
|
@@ -6287,6 +6287,7 @@ export struct LocalMusic {
|
|
|
.width(180)
|
|
|
}
|
|
|
.height('auto')
|
|
|
+ .scrollBar(this.isGridMusic?BarState.On:BarState.Off)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -7486,6 +7487,7 @@ export struct LocalMusic {
|
|
|
newInput = tempOutPath
|
|
|
tempOutPath = ''
|
|
|
}
|
|
|
+ const isWav:boolean = newInput.toLowerCase().endsWith('.wav');
|
|
|
//内嵌下标签的值,设置overwrite为true会直接修改原文件
|
|
|
const result:boolean = await repairAudioMetadata(
|
|
|
newInput,
|
|
|
@@ -7495,7 +7497,7 @@ export struct LocalMusic {
|
|
|
tempOutPath
|
|
|
);
|
|
|
|
|
|
- if (result) {
|
|
|
+ if (result||isWav) {
|
|
|
if(!item.filePath.includes(this.packName)){
|
|
|
//内嵌成功的歌路径如果不是包含包名,则要入库
|
|
|
let newItem: VideoItem = await Utility.uriGetMusicAssetsFromFile(this.context, newInput,
|
|
|
@@ -7525,7 +7527,11 @@ export struct LocalMusic {
|
|
|
taskpool.execute(task, taskpool.Priority.HIGH).then((result) => {
|
|
|
if (result) {
|
|
|
console.log(" onecold 编辑信息成功,数据库已同步");
|
|
|
- ToastUtil.showToast('内嵌音乐标签成功')
|
|
|
+ if(isWav){
|
|
|
+ ToastUtil.showToast('wav格式有可能内嵌失败,但是编辑信息成功')
|
|
|
+ }else{
|
|
|
+ ToastUtil.showToast('内嵌音乐标签成功')
|
|
|
+ }
|
|
|
this.isShowMoreView = false
|
|
|
this.name = this.titleStr
|
|
|
this.syncEditedFields(item)
|
|
|
@@ -7779,16 +7785,34 @@ export struct LocalMusic {
|
|
|
.fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
|
|
|
- TextInput({ text: item.name })
|
|
|
+ TextInput({ text: this.titleStr||item.name })
|
|
|
.height(40)
|
|
|
.maxLines(1)
|
|
|
.fontSize(14)
|
|
|
.layoutWeight(1)
|
|
|
.fontColor($r('app.color.text_color'))
|
|
|
- .margin({ right: 20, left: 10 })
|
|
|
+ .margin({ right: 15, left: 10 })
|
|
|
.onChange((val: string) => {
|
|
|
this.titleStr = val
|
|
|
})
|
|
|
+ Button('修复乱码',{ type: ButtonType.Capsule, stateEffect: true})
|
|
|
+ .clickEffect({ level: ClickEffectLevel.MIDDLE,scale:0.6 })
|
|
|
+ .backgroundColor(this.themeColor)
|
|
|
+ .fontSize(10)
|
|
|
+ .margin({ right: 20})
|
|
|
+ .onClick(async () => {
|
|
|
+ let hwTags = await extractHwMediaMetadata(item.filePath)
|
|
|
+ let artist = hwTags?.artist|| '';
|
|
|
+ let title = hwTags?.title|| '';
|
|
|
+ let album = hwTags?.album|| '';
|
|
|
+ console.info('onecold 乱码修正 artist='+artist);
|
|
|
+ console.info('onecold 乱码修正 title='+title);
|
|
|
+ console.info('onecold 乱码修正 album='+album);
|
|
|
+ this.titleStr = title;
|
|
|
+ this.artistStr = artist;
|
|
|
+ this.ablumStr = album;
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
.width('100%')
|
|
|
.margin({ top: 10, bottom: 10 })
|
|
|
@@ -7800,7 +7824,7 @@ export struct LocalMusic {
|
|
|
.fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
|
|
|
- TextInput({ text: item.artist })
|
|
|
+ TextInput({ text: this.artistStr||item.artist })
|
|
|
.height(40)
|
|
|
.maxLines(1)
|
|
|
.fontSize(14)
|
|
|
@@ -7820,7 +7844,7 @@ export struct LocalMusic {
|
|
|
.fontSize(14)
|
|
|
.fontColor($r('app.color.text_color'))
|
|
|
.margin({ left: 22 })
|
|
|
- TextInput({ text: item.album })
|
|
|
+ TextInput({ text: this.ablumStr||item.album })
|
|
|
.height(40)
|
|
|
.maxLines(1)
|
|
|
.fontSize(14)
|
|
|
@@ -11078,7 +11102,7 @@ export struct LocalMusic {
|
|
|
.fontWeight(FontWeight.Bold)
|
|
|
.textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
|
|
|
.maxLines(1)
|
|
|
- .width('48%')
|
|
|
+ .width('85%')
|
|
|
.textAlign(TextAlign.Center)
|
|
|
.fontColor(Color.White)
|
|
|
.visibility(this.isPhoneLan() ? Visibility.None : Visibility.Visible)
|