|
@@ -140,6 +140,8 @@ export struct WebDavMainPage {
|
|
|
@State isAllSelected: boolean = false
|
|
@State isAllSelected: boolean = false
|
|
|
@State isDeletingSelection: boolean = false
|
|
@State isDeletingSelection: boolean = false
|
|
|
@State ignoreTapAfterExitMultiSelect: boolean = false
|
|
@State ignoreTapAfterExitMultiSelect: boolean = false
|
|
|
|
|
+ @State isShowSongPropertySheet: boolean = false
|
|
|
|
|
+ @State songForPropertySheet: VideoItem | undefined = undefined
|
|
|
@State rootPath: string = ''
|
|
@State rootPath: string = ''
|
|
|
@State isShowDownloadCenter: boolean = false
|
|
@State isShowDownloadCenter: boolean = false
|
|
|
@State downloadCenterTabIndex: number[] = [0]
|
|
@State downloadCenterTabIndex: number[] = [0]
|
|
@@ -2358,6 +2360,107 @@ export struct WebDavMainPage {
|
|
|
this.updateListData(this.filteredList);
|
|
this.updateListData(this.filteredList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private openSongPropertySheet(song: VideoItem): void {
|
|
|
|
|
+ this.songForPropertySheet = song;
|
|
|
|
|
+ this.isShowSongPropertySheet = true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private getSongPropertyValue(value: string | number | undefined): string {
|
|
|
|
|
+ if (value === undefined) {
|
|
|
|
|
+ return '--';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (typeof value === 'number') {
|
|
|
|
|
+ return `${value}`;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (StrUtil.isEmpty(value)) {
|
|
|
|
|
+ return '--';
|
|
|
|
|
+ }
|
|
|
|
|
+ return value;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private getSongTypeLabel(song: VideoItem | undefined): string {
|
|
|
|
|
+ if (!song) {
|
|
|
|
|
+ return '--';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (song.type === CommonConstants.TYPE_LOCAL) {
|
|
|
|
|
+ return '本地';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (song.type === CommonConstants.TYPE_WEBDAV) {
|
|
|
|
|
+ return 'WebDAV';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (song.type === CommonConstants.TYPE_JELLYFIN) {
|
|
|
|
|
+ return 'Jellyfin';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (song.type === CommonConstants.TYPE_EMBY) {
|
|
|
|
|
+ return 'Emby';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (song.type === CommonConstants.TYPE_AUDIOSTATION) {
|
|
|
|
|
+ return 'AudioStation';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (song.type === CommonConstants.TYPE_BAIDU) {
|
|
|
|
|
+ return '百度网盘';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (song.type === CommonConstants.TYPE_NAVIDROME) {
|
|
|
|
|
+ return 'Navidrome';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (song.type === CommonConstants.TYPE_PLEX) {
|
|
|
|
|
+ return 'Plex';
|
|
|
|
|
+ }
|
|
|
|
|
+ return `${song.type}`;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Builder
|
|
|
|
|
+ private SongPropertyRow(label: string, value: string) {
|
|
|
|
|
+ Column({ space: 4 }) {
|
|
|
|
|
+ Text(label)
|
|
|
|
|
+ .fontSize(12)
|
|
|
|
|
+ .fontColor($r('app.color.index_tab_font_color'))
|
|
|
|
|
+ .opacity(0.7)
|
|
|
|
|
+ Text(value)
|
|
|
|
|
+ .fontSize(14)
|
|
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
|
|
+ .maxLines(6)
|
|
|
|
|
+ .textOverflow({ overflow: TextOverflow.Ellipsis })
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .alignItems(HorizontalAlign.Start)
|
|
|
|
|
+ .padding({ left: 2, right: 2, top: 4, bottom: 4 })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Builder
|
|
|
|
|
+ private SongPropertySheetBuilder() {
|
|
|
|
|
+ if (this.songForPropertySheet) {
|
|
|
|
|
+ Column({ space: 10 }) {
|
|
|
|
|
+ this.SongPropertyRow('歌曲名称', this.getSongPropertyValue(this.songForPropertySheet?.name))
|
|
|
|
|
+ this.SongPropertyRow('文件名称', this.getSongPropertyValue(this.songForPropertySheet?.fileName))
|
|
|
|
|
+ this.SongPropertyRow('艺术家', this.getSongPropertyValue(this.songForPropertySheet?.artist))
|
|
|
|
|
+ this.SongPropertyRow('专辑', this.getSongPropertyValue(this.songForPropertySheet?.album))
|
|
|
|
|
+ this.SongPropertyRow('时长', this.getSongPropertyValue(this.songForPropertySheet?.duration))
|
|
|
|
|
+ this.SongPropertyRow('文件大小', this.getSongPropertyValue(this.songForPropertySheet?.size))
|
|
|
|
|
+ this.SongPropertyRow('比特率', this.getSongPropertyValue(this.songForPropertySheet?.bit_rate))
|
|
|
|
|
+ this.SongPropertyRow('采样率', this.getSongPropertyValue(this.songForPropertySheet?.sampleRate))
|
|
|
|
|
+ this.SongPropertyRow('声道数', this.getSongPropertyValue(this.songForPropertySheet?.channels))
|
|
|
|
|
+ this.SongPropertyRow('编码类型', this.getSongPropertyValue(this.songForPropertySheet?.mimeType))
|
|
|
|
|
+ this.SongPropertyRow('创建时间', this.getSongPropertyValue(this.songForPropertySheet?.cTime))
|
|
|
|
|
+ this.SongPropertyRow('来源类型', this.getSongTypeLabel(this.songForPropertySheet))
|
|
|
|
|
+ this.SongPropertyRow('文件路径', this.getSongPropertyValue(this.songForPropertySheet?.filePath))
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .padding({ left: 12, right: 12, top: 8, bottom: 12 })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Column() {
|
|
|
|
|
+ Text('暂无歌曲属性信息')
|
|
|
|
|
+ .fontSize(14)
|
|
|
|
|
+ .fontColor($r('app.color.text_color'))
|
|
|
|
|
+ .opacity(0.65)
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%')
|
|
|
|
|
+ .height('100%')
|
|
|
|
|
+ .justifyContent(FlexAlign.Center)
|
|
|
|
|
+ .alignItems(HorizontalAlign.Center)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
build() {
|
|
build() {
|
|
|
Stack() {
|
|
Stack() {
|
|
|
if (this.accounts.length === 0) {
|
|
if (this.accounts.length === 0) {
|
|
@@ -2394,6 +2497,14 @@ export struct WebDavMainPage {
|
|
|
.backgroundImagePosition(Alignment.Center)
|
|
.backgroundImagePosition(Alignment.Center)
|
|
|
.backdropBlur(this.blurValue)
|
|
.backdropBlur(this.blurValue)
|
|
|
.backgroundBrightness({rate:this.isCustomizeBg?0.1:0,lightUpDegree:this.bgBrightness})
|
|
.backgroundBrightness({rate:this.isCustomizeBg?0.1:0,lightUpDegree:this.bgBrightness})
|
|
|
|
|
+ .bindSheet($$this.isShowSongPropertySheet, this.SongPropertySheetBuilder(), {
|
|
|
|
|
+ height: '88%',
|
|
|
|
|
+ dragBar: true,
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ preferType: SheetType.CENTER,
|
|
|
|
|
+ blurStyle: BlurStyle.Thin,
|
|
|
|
|
+ title: { title: '歌曲属性' }
|
|
|
|
|
+ })
|
|
|
.bindContentCover($$this.isShowDownloadCenter, this.DownloadCenterBuilder(), {
|
|
.bindContentCover($$this.isShowDownloadCenter, this.DownloadCenterBuilder(), {
|
|
|
transition: TransitionEffect.translate({ x: 500 }).animation({ curve: curves.springMotion(0.6, 0.8) })
|
|
transition: TransitionEffect.translate({ x: 500 }).animation({ curve: curves.springMotion(0.6, 0.8) })
|
|
|
})
|
|
})
|
|
@@ -2840,6 +2951,14 @@ export struct WebDavMainPage {
|
|
|
.onClick(async () => {
|
|
.onClick(async () => {
|
|
|
await this.enqueueSongDownload(song);
|
|
await this.enqueueSongDownload(song);
|
|
|
})
|
|
})
|
|
|
|
|
+ //属性
|
|
|
|
|
+ MenuItem({
|
|
|
|
|
+ symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.music_note_list')),
|
|
|
|
|
+ content: '属性'
|
|
|
|
|
+ })
|
|
|
|
|
+ .onClick(() => {
|
|
|
|
|
+ this.openSongPropertySheet(song);
|
|
|
|
|
+ })
|
|
|
//删除
|
|
//删除
|
|
|
MenuItem({
|
|
MenuItem({
|
|
|
symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.trash')),
|
|
symbolStartIcon: new SymbolGlyphModifier($r('sys.symbol.trash')),
|