فهرست منبع

简化添加网盘的一些选项

onecold 8 ماه پیش
والد
کامیت
d11e8ade7d
2فایلهای تغییر یافته به همراه53 افزوده شده و 48 حذف شده
  1. 50 47
      entry/src/main/ets/dialog/RemoteDriveAccountDialog.ets
  2. 3 1
      entry/src/main/ets/view/LocalMusic.ets

+ 50 - 47
entry/src/main/ets/dialog/RemoteDriveAccountDialog.ets

@@ -248,36 +248,38 @@ export struct RemoteDriveAccountDialog {
       .alignItems(VerticalAlign.Center);
       // this.buildHelperText('若留空将自动使用协议默认端口')
 
-      if (this.driveType === RemoteDriveType.Smb) {
-        // SMB 共享名称
-        Row({ space: 8 }) {
-          Text('共享名称')
-            .fontSize(14)
-            .fontColor($r('app.color.index_tab_font_color'));
-          TextInput({ placeholder: '共享名称', text: this.shareName })
-            .layoutWeight(1)
-            .maxLines(1)
-            .onChange((value: string) => {
-              this.shareName = value;
-            });
-        }
-        .alignItems(VerticalAlign.Center);
-        this.buildHelperText('NAS 上共享根目录的名称,例如 music、share')
-
-        Row({ space: 8 }) {
-          Text('域/工作组')
-            .fontSize(14)
-            .fontColor($r('app.color.index_tab_font_color'));
-          TextInput({ placeholder: '可选项', text: this.domain })
-            .layoutWeight(1)
-            .maxLines(1)
-            .onChange((value: string) => {
-              this.domain = value;
-            });
-        }
-        .alignItems(VerticalAlign.Center);
-        this.buildHelperText('可选,用于需要域/工作组认证的 SMB 服务器')
-      }
+      // if (this.driveType === RemoteDriveType.Smb) {
+      //   // SMB 共享名称
+      //   Row({ space: 8 }) {
+      //     Text('共享名称')
+      //       .fontSize(14)
+      //       .fontColor($r('app.color.index_tab_font_color'));
+      //     TextInput({ placeholder: '共享名称', text: this.shareName })
+      //       .layoutWeight(1)
+      //       .maxLines(1)
+      //       .onChange((value: string) => {
+      //         this.shareName = value;
+      //       });
+      //   }
+      //   .alignItems(VerticalAlign.Center)
+      //   .visibility(Visibility.None)
+      //   // this.buildHelperText('NAS 上共享根目录的名称,例如 music、share')
+      //
+      //   Row({ space: 8 }) {
+      //     Text('域/工作组')
+      //       .fontSize(14)
+      //       .fontColor($r('app.color.index_tab_font_color'));
+      //     TextInput({ placeholder: '可选项', text: this.domain })
+      //       .layoutWeight(1)
+      //       .maxLines(1)
+      //       .onChange((value: string) => {
+      //         this.domain = value;
+      //       });
+      //   }
+      //   .alignItems(VerticalAlign.Center)
+      //   .visibility(Visibility.None)
+      //   // this.buildHelperText('可选,用于需要域/工作组认证的 SMB 服务器')
+      // }
 
       if (this.driveType === RemoteDriveType.Ftp) {
         Row({ space: 8 }) {
@@ -295,22 +297,22 @@ export struct RemoteDriveAccountDialog {
         this.buildHelperText('若目录或文件名为中文,可根据服务器设置调整编码');
       }
 
-      if (this.driveType === RemoteDriveType.Navidrome) {
-        Row({ space: 8 }) {
-          Text('API路径')
-            .fontSize(14)
-            .fontColor($r('app.color.index_tab_font_color'));
-          TextInput({ placeholder: '/rest', text: this.navidromeBasePath })
-            .layoutWeight(1)
-            .maxLines(1)
-            .onChange((value: string) => {
-              this.navidromeBasePath = this.normalizeNavidromeBasePath(value);
-              this.navBasePathCustomized = true;
-            });
-        }
-        .alignItems(VerticalAlign.Center);
-        this.buildHelperText('Navidrome/Subsonic REST 前缀,默认 /rest,可填 /navidrome/rest 等路径')
-      }
+      // if (this.driveType === RemoteDriveType.Navidrome) {
+      //   Row({ space: 8 }) {
+      //     Text('API路径')
+      //       .fontSize(14)
+      //       .fontColor($r('app.color.index_tab_font_color'));
+      //     TextInput({ placeholder: '/rest', text: this.navidromeBasePath })
+      //       .layoutWeight(1)
+      //       .maxLines(1)
+      //       .onChange((value: string) => {
+      //         this.navidromeBasePath = this.normalizeNavidromeBasePath(value);
+      //         this.navBasePathCustomized = true;
+      //       });
+      //   }
+      //   .alignItems(VerticalAlign.Center);
+      //   this.buildHelperText('Navidrome/Subsonic REST 前缀,默认 /rest,可填 /navidrome/rest 等路径')
+      // }
 
       // 文件目录
       Row({ space: 8 }) {
@@ -324,7 +326,8 @@ export struct RemoteDriveAccountDialog {
             this.filepath = value;
           });
       }
-      .alignItems(VerticalAlign.Center);
+      .alignItems(VerticalAlign.Center)
+      .visibility(this.driveType === RemoteDriveType.Navidrome? Visibility.None:Visibility.Visible)
       // this.buildHelperText('从共享根开始的路径,例如 /music 或 /音乐/歌单1')
 
       // 用户名

+ 3 - 1
entry/src/main/ets/view/LocalMusic.ets

@@ -1987,6 +1987,7 @@ export struct LocalMusic {
       this.stop();
     }
     this.mIjkMediaPlayer.off('audioInterrupt');
+    this.mIjkMediaPlayer.off('deviceChange');
     if (workerInstance) {
       workerInstance.terminate();
     }
@@ -9237,6 +9238,7 @@ export struct LocalMusic {
                     $r('app.color.text_color'))
                   .fontWeight(500)
                   .borderRadius(12)
+                  .visibility(StrUtil.isEmpty(item.md5Str) ? Visibility.None : Visibility.Visible)
                   .margin({ left: this.sonTwoFingerType == 3 ? 12 : 10 })
                   .backgroundColor('#FFC107')
               }
@@ -9248,7 +9250,7 @@ export struct LocalMusic {
                 .maxLines(1)
                 .fontColor(this.curIndex === index ? this.themeColor :
                   this.isFrontWhite ? $r('app.color.playlistText_color') : $r('app.color.text_color'))
-                .margin({ left: this.sonTwoFingerType == 3 ? 5 : 3 })
+                .margin({ left: StrUtil.isEmpty(item.md5Str)? 12 :this.sonTwoFingerType == 3 ? 5 : 3 })
               Blank()
               Text(item.size)
                 .fontSize(this.sonTwoFingerType == 1 ? 11 : this.sonTwoFingerType == 2 ? 12 : 14)