Ver código fonte

默认网盘界面的时候,Navidrome界面没有加载问题

onecold 7 meses atrás
pai
commit
f507913ab8

+ 36 - 26
entry/src/main/ets/pages/NewIndex.ets

@@ -163,7 +163,13 @@ struct NewIndex {
       this.mType = 0
       this.mType = 0
     } else if(this.tabSelectedIndexes[0]==2){
     } else if(this.tabSelectedIndexes[0]==2){
       // 网盘选项卡
       // 网盘选项卡
-      this.mType = 6
+      if(this.webDavAccounts.length>0&&(this.webDavAccounts[0].webType===RemoteDriveType.Navidrome||
+        this.webDavAccounts[0].webType===RemoteDriveType.Jellyfin||
+        this.webDavAccounts[0].webType===RemoteDriveType.Emby)){
+        this.mType = 7
+      }else{
+        this.mType = 6
+      }
     }
     }
   }
   }
   // 歌单相关状态变量
   // 歌单相关状态变量
@@ -256,31 +262,7 @@ struct NewIndex {
     this.isShowPrecious = PreferencesUtil.getBooleanSync('isShowPrecious', false)
     this.isShowPrecious = PreferencesUtil.getBooleanSync('isShowPrecious', false)
     ReqPermissionUtil.reqPermissionsFromUser(ReqPermissionUtil.permissions, this.context);
     ReqPermissionUtil.reqPermissionsFromUser(ReqPermissionUtil.permissions, this.context);
     this.isShowTitleBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_TITLTBAR, false)
     this.isShowTitleBar = PreferencesUtil.getBooleanSync(SettingPage.IS_SHOW_TITLTBAR, false)
-    if(this.defalut_home_type==0){
-      this.mType = 0
-    }else if(this.defalut_home_type==1){
-      this.mType = 0
-      this.modeType = 1
-    }else if(this.defalut_home_type==2){
-      if(this.webDavAccounts.length>0){
-       if(this.webDavAccounts[0].webType===RemoteDriveType.Navidrome||
-         this.webDavAccounts[0].webType===RemoteDriveType.Jellyfin||
-         this.webDavAccounts[0].webType===RemoteDriveType.Emby){
-         this.mType = 7
-       }else{
-         this.mType = 6
-       }
-      }else{
-        this.mType = 6
-      }
-      this.tabSelectedIndexes[0]=2
-    }else if(this.defalut_home_type==3){
-      this.mType = 0
-      this.modeType = 2
-    }else if(this.defalut_home_type==4){
-      this.mType = 0
-      this.modeType = 3
-    }
+
     Utility.enableFullScreen()
     Utility.enableFullScreen()
     this.topRectHeight = px2vp(AppUtil.getStatusBarHeight());
     this.topRectHeight = px2vp(AppUtil.getStatusBarHeight());
     Utility.getAppName(getContext(this)).then((appName: string) => {
     Utility.getAppName(getContext(this)).then((appName: string) => {
@@ -364,6 +346,34 @@ struct NewIndex {
         PreferencesUtil.putSync('isShowHaoPingDialog179', true)
         PreferencesUtil.putSync('isShowHaoPingDialog179', true)
       },25000)
       },25000)
     }
     }
+    if(this.defalut_home_type==0){
+      this.mType = 0
+    }else if(this.defalut_home_type==1){
+      this.mType = 0
+      this.modeType = 1
+    }else if(this.defalut_home_type==2){//如果是网盘的话
+      if(this.webDavAccounts.length>0){
+        console.info('onecold 网盘 默认首页2 this.webDavAccounts[0].webType='+this.webDavAccounts[0].webType )
+        if(this.webDavAccounts[0].webType===RemoteDriveType.Navidrome||
+          this.webDavAccounts[0].webType===RemoteDriveType.Jellyfin||
+          this.webDavAccounts[0].webType===RemoteDriveType.Emby){
+          this.mType = 7
+          this.selectWebDavAccount(this.webDavAccounts[0])
+        }else{
+          this.mType = 6
+        }
+      }else{
+        this.mType = 6
+      }
+      this.tabSelectedIndexes[0]=2
+    }else if(this.defalut_home_type==3){
+      this.mType = 0
+      this.modeType = 2
+    }else if(this.defalut_home_type==4){
+      this.mType = 0
+      this.modeType = 3
+    }
+    console.info('onecold 网盘 默认首页2 this.mType='+this.mType )
   }
   }
 
 
   /**
   /**

+ 0 - 8
entry/src/main/ets/view/LocalMusic.ets

@@ -11319,14 +11319,6 @@ export struct LocalMusic {
           .width($r('app.float.title_image_size'))// .aspectRatio(CommonConstants.ASPECT_RATIO)
           .width($r('app.float.title_image_size'))// .aspectRatio(CommonConstants.ASPECT_RATIO)
           .hitTestBehavior(HitTestMode.Transparent)
           .hitTestBehavior(HitTestMode.Transparent)
 
 
-        Text(this.name + '  ' + this.artist)
-          .fontColor(Color.White)
-          .fontSize($r('app.float.title_font_size'))
-          .textOverflow({ overflow: TextOverflow.MARQUEE })//超长滚动
-          .maxLines(1)
-          .visibility(Visibility.None)
-          .margin({ left: 2, right: 30 })
-
       }
       }
       .layoutWeight(1)
       .layoutWeight(1)
       .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })
       .clickEffect({ level: ClickEffectLevel.LIGHT, scale: 0.5 })