|
|
@@ -21,11 +21,13 @@ export struct TagsContentCover {
|
|
|
private listScroller: ListScroller = new ListScroller()
|
|
|
onTagsResult = (_result: boolean,deleteCache_path?:string) => {
|
|
|
}
|
|
|
+ onSeePath = (path:string) => {
|
|
|
+ }
|
|
|
+
|
|
|
@State isLyric:boolean = true
|
|
|
@State isCover:boolean = true
|
|
|
@State download_path:string = ''
|
|
|
@Link isOneKeyTags: boolean;
|
|
|
- @Prop table: MediaTable
|
|
|
@State packName: string = ''
|
|
|
@State dataSource: LazyDataSource<VideoItem> = new LazyDataSource([])
|
|
|
@Prop selectedFiles: Array<VideoItem>
|
|
|
@@ -49,13 +51,14 @@ export struct TagsContentCover {
|
|
|
// 分别跟踪歌词和封面嵌入状态
|
|
|
@State lyricEmbedStatusMap: Map<string, boolean> = new Map<string, boolean>();
|
|
|
@State coverEmbedStatusMap: Map<string, boolean> = new Map<string, boolean>();
|
|
|
-
|
|
|
+ @State table: MediaTable = new MediaTable(this.context);
|
|
|
|
|
|
onColorModeChange() {
|
|
|
this.isDarkMode = this.currentMode === ConfigurationConstant.ColorMode.COLOR_MODE_DARK
|
|
|
}
|
|
|
|
|
|
async aboutToAppear() {
|
|
|
+
|
|
|
this.download_path = PreferencesUtil.getStringSync('download_path')+'批量内嵌'+'/'
|
|
|
if (!FileUtil.accessSync(this.download_path)) {
|
|
|
FileUtil.mkdirSync(this.download_path)
|
|
|
@@ -68,6 +71,13 @@ export struct TagsContentCover {
|
|
|
} else {
|
|
|
this.dataSource = new LazyDataSource([])
|
|
|
}
|
|
|
+
|
|
|
+ // 初始化数据库
|
|
|
+ await new Promise<void>((resolve, reject) => {
|
|
|
+ this.table.getRdbStore(this.context, (err:Error) => {
|
|
|
+ err ? reject(err) : resolve();
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -147,7 +157,7 @@ export struct TagsContentCover {
|
|
|
.fontColor([this.themeColor])
|
|
|
.alignSelf(ItemAlign.Center)
|
|
|
.margin({ left: 15 })
|
|
|
- Text('说明:不是本app路径下的歌曲将在[DownLoad/天天静听/批量内嵌]文件夹中生成新的内嵌歌曲。如果失败可以多试几次。')
|
|
|
+ Text('说明:不是本app路径下的歌曲将在【DownLoad/天天静听/批量内嵌】文件夹中生成新的内嵌歌曲。如果失败可以多试几次。')
|
|
|
.margin({ left: 5 ,right: 5})
|
|
|
.fontSize(14)
|
|
|
.padding({top:4,bottom:4})
|
|
|
@@ -255,15 +265,17 @@ export struct TagsContentCover {
|
|
|
Text(`正在处理: ${this.currentFileIndex}/${this.totalFiles}`)
|
|
|
.fontSize(12)
|
|
|
.fontColor($r('app.color.text_color'))
|
|
|
+
|
|
|
+ Text(`${this.currentProgress}%`)
|
|
|
+ .margin({ left: 5 })
|
|
|
+ .fontSize(12)
|
|
|
+ .fontWeight(480)
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
}
|
|
|
.width('100%')
|
|
|
.margin({left:20,right:8})
|
|
|
|
|
|
- Text(`${this.currentProgress}%`)
|
|
|
- .margin({ left: 5 })
|
|
|
- .fontSize(15)
|
|
|
- .fontWeight(480)
|
|
|
- .fontColor($r('app.color.text_color'))
|
|
|
+
|
|
|
|
|
|
Blank()
|
|
|
|
|
|
@@ -626,57 +638,57 @@ export struct TagsContentCover {
|
|
|
Blank()
|
|
|
// 歌词嵌入状态
|
|
|
|
|
|
- Row() {
|
|
|
- Text('歌词')
|
|
|
- .fontSize(12)
|
|
|
- .fontColor(this.themeColor)
|
|
|
- // 只有当状态存在时才显示图标
|
|
|
- SymbolGlyph(this.lyricEmbedStatusMap.get(item.filePath)?$r('sys.symbol.checkmark_circle'):$r('sys.symbol.xmark_circle'))
|
|
|
- .fontSize(16)
|
|
|
- .margin({ left: 4 })
|
|
|
- .fontColor([this.themeColor])
|
|
|
- .alignSelf(ItemAlign.Center)
|
|
|
- .visibility(this.lyricEmbedStatusMap.has(item.filePath)?Visibility.Visible:Visibility.Hidden)
|
|
|
- .animation({
|
|
|
- duration: 666,
|
|
|
- curve: 'ease-in-out'
|
|
|
- })
|
|
|
- }
|
|
|
- .visibility(this.isLyric?Visibility.Visible:Visibility.None)
|
|
|
- .animation({
|
|
|
- duration: 666,
|
|
|
- curve: 'ease-in-out'
|
|
|
- })
|
|
|
- .padding({ right:10 })
|
|
|
+ Row() {
|
|
|
+ Text('歌词')
|
|
|
+ .fontSize(12)
|
|
|
+ .fontColor(this.themeColor)
|
|
|
+ // 只有当状态存在时才显示图标
|
|
|
+ SymbolGlyph(this.lyricEmbedStatusMap.get(item.filePath)?$r('sys.symbol.checkmark_circle'):$r('sys.symbol.xmark_circle'))
|
|
|
+ .fontSize(16)
|
|
|
+ .margin({ left: 4 })
|
|
|
+ .fontColor([this.themeColor])
|
|
|
+ .alignSelf(ItemAlign.Center)
|
|
|
+ .visibility(this.lyricEmbedStatusMap.has(item.filePath)?Visibility.Visible:Visibility.Hidden)
|
|
|
+ .animation({
|
|
|
+ duration: 666,
|
|
|
+ curve: 'ease-in-out'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .visibility(this.isLyric?Visibility.Visible:Visibility.None)
|
|
|
+ .animation({
|
|
|
+ duration: 666,
|
|
|
+ curve: 'ease-in-out'
|
|
|
+ })
|
|
|
+ .padding({ right:10 })
|
|
|
|
|
|
|
|
|
// 封面嵌入状态
|
|
|
|
|
|
- Row() {
|
|
|
- Text('封面')
|
|
|
- .fontSize(12)
|
|
|
- .fontColor(this.themeColor)
|
|
|
- // 只有当状态存在时才显示图标
|
|
|
-
|
|
|
- SymbolGlyph(this.coverEmbedStatusMap.get(item.filePath)?$r('sys.symbol.checkmark_circle'):$r('sys.symbol.xmark_circle'))
|
|
|
- .fontSize(16)
|
|
|
- .margin({ left: 4 })
|
|
|
- .fontColor([this.themeColor])
|
|
|
- .alignSelf(ItemAlign.Center)
|
|
|
- .visibility(this.coverEmbedStatusMap.has(item.filePath)?Visibility.Visible:Visibility.Hidden)
|
|
|
- .animation({
|
|
|
- duration: 666,
|
|
|
- curve: 'ease-in-out'
|
|
|
- })
|
|
|
+ Row() {
|
|
|
+ Text('封面')
|
|
|
+ .fontSize(12)
|
|
|
+ .fontColor(this.themeColor)
|
|
|
+ // 只有当状态存在时才显示图标
|
|
|
|
|
|
- }
|
|
|
- .margin({ left: 5 })
|
|
|
- .visibility(this.isCover?Visibility.Visible:Visibility.None)
|
|
|
- .animation({
|
|
|
- duration: 666,
|
|
|
- curve: 'ease-in-out'
|
|
|
- })
|
|
|
- .padding({ right: 25 })
|
|
|
+ SymbolGlyph(this.coverEmbedStatusMap.get(item.filePath)?$r('sys.symbol.checkmark_circle'):$r('sys.symbol.xmark_circle'))
|
|
|
+ .fontSize(16)
|
|
|
+ .margin({ left: 4 })
|
|
|
+ .fontColor([this.themeColor])
|
|
|
+ .alignSelf(ItemAlign.Center)
|
|
|
+ .visibility(this.coverEmbedStatusMap.has(item.filePath)?Visibility.Visible:Visibility.Hidden)
|
|
|
+ .animation({
|
|
|
+ duration: 666,
|
|
|
+ curve: 'ease-in-out'
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ .margin({ left: 5 })
|
|
|
+ .visibility(this.isCover?Visibility.Visible:Visibility.None)
|
|
|
+ .animation({
|
|
|
+ duration: 666,
|
|
|
+ curve: 'ease-in-out'
|
|
|
+ })
|
|
|
+ .padding({ right: 25 })
|
|
|
|
|
|
|
|
|
}
|