ソースを参照

只针对TYPE_WEBDAV的filePath的replace(/ /g, '%20');

onecold 9 ヶ月 前
コミット
752d4b1046
1 ファイル変更42 行追加9 行削除
  1. 42 9
      entry/src/main/ets/view/LocalMusic.ets

+ 42 - 9
entry/src/main/ets/view/LocalMusic.ets

@@ -1133,7 +1133,11 @@ export struct LocalMusic {
           this.isFirstStartPlay = false
           this.isFirstStartPlay = false
           this.currentSong = this.songList[0]
           this.currentSong = this.songList[0]
         }
         }
-        this.videoUrl = this.currentSong.filePath.replace(/ /g, '%20');
+        if(this.currentSong.type==CommonConstants.TYPE_WEBDAV){
+          this.videoUrl = this.currentSong.filePath.replace(/ /g, '%20');
+        }else{
+          this.videoUrl =  this.currentSong.filePath
+        }
         this.name = this.currentSong.name
         this.name = this.currentSong.name
         this.cover = this.currentSong.pixelMapPath
         this.cover = this.currentSong.pixelMapPath
         AppStorage.setOrCreate('currentSong',this.currentSong) ;
         AppStorage.setOrCreate('currentSong',this.currentSong) ;
@@ -5516,7 +5520,7 @@ export struct LocalMusic {
         }
         }
 
 
         AppStorage.setOrCreate('currentSong',this.currentSong) ;
         AppStorage.setOrCreate('currentSong',this.currentSong) ;
-        this.videoUrl = this.currentSong.filePath.replace(/ /g, '%20');
+        this.videoUrl = this.currentSong.filePath
         this.name = this.currentSong.name
         this.name = this.currentSong.name
         this.cover = this.currentSong.pixelMapPath
         this.cover = this.currentSong.pixelMapPath
         this.artist = this.currentSong.artist
         this.artist = this.currentSong.artist
@@ -5627,7 +5631,11 @@ export struct LocalMusic {
           }
           }
           this.songList = globalVideoList
           this.songList = globalVideoList
           this.sonDataSource.pushArrayData(this.songList)
           this.sonDataSource.pushArrayData(this.songList)
-          this.videoUrl = this.currentSong.filePath.replace(/ /g, '%20');
+          if(this.currentSong.type==CommonConstants.TYPE_WEBDAV){
+            this.videoUrl = this.currentSong.filePath.replace(/ /g, '%20');
+          }else{
+            this.videoUrl =  this.currentSong.filePath
+          }
           this.name = item.title||this.currentSong.name
           this.name = item.title||this.currentSong.name
           this.cover = this.currentSong.pixelMapPath
           this.cover = this.currentSong.pixelMapPath
           this.artist = item.performer||this.currentSong.artist
           this.artist = item.performer||this.currentSong.artist
@@ -12807,7 +12815,12 @@ export struct LocalMusic {
       this.CONTROL_PlayStatus = PlayStatus.INIT;
       this.CONTROL_PlayStatus = PlayStatus.INIT;
       this.stop();
       this.stop();
       this.currentSong = this.songList[this.curIndex]
       this.currentSong = this.songList[this.curIndex]
-      this.videoUrl = this.songList[this.curIndex].filePath.replace(/ /g, '%20');
+      if(this.currentSong.type==CommonConstants.TYPE_WEBDAV){
+        this.videoUrl = this.currentSong.filePath.replace(/ /g, '%20');
+      }else{
+        this.videoUrl = this.currentSong.filePath
+      }
+
       this.artist = this.songList[this.curIndex].artist
       this.artist = this.songList[this.curIndex].artist
       this.name = this.songList[this.curIndex].name
       this.name = this.songList[this.curIndex].name
       //this.cover = this.songList[this.curIndex].pixelMapPath
       //this.cover = this.songList[this.curIndex].pixelMapPath
@@ -12895,7 +12908,11 @@ export struct LocalMusic {
       this.CONTROL_PlayStatus = PlayStatus.INIT;
       this.CONTROL_PlayStatus = PlayStatus.INIT;
       this.stop();
       this.stop();
       this.currentSong = this.songList[this.curIndex];
       this.currentSong = this.songList[this.curIndex];
-      this.videoUrl = this.songList[this.curIndex].filePath.replace(/ /g, '%20');
+      if(this.currentSong.type==CommonConstants.TYPE_WEBDAV){
+        this.videoUrl = this.currentSong.filePath.replace(/ /g, '%20');
+      }else{
+        this.videoUrl = this.currentSong.filePath
+      }
       this.name = this.songList[this.curIndex].name;
       this.name = this.songList[this.curIndex].name;
       this.artist = this.songList[this.curIndex].artist
       this.artist = this.songList[this.curIndex].artist
       // this.cover = this.songList[this.curIndex].pixelMapPath
       // this.cover = this.songList[this.curIndex].pixelMapPath
@@ -12912,7 +12929,11 @@ export struct LocalMusic {
       this.CONTROL_PlayStatus = PlayStatus.INIT;
       this.CONTROL_PlayStatus = PlayStatus.INIT;
       this.stop();
       this.stop();
       this.currentSong = this.songList[this.curIndex]
       this.currentSong = this.songList[this.curIndex]
-      this.videoUrl = this.songList[index].filePath.replace(/ /g, '%20');
+      if(this.currentSong.type===CommonConstants.TYPE_WEBDAV){
+        this.videoUrl = this.songList[index].filePath.replace(/ /g, '%20');
+      }else{
+        this.videoUrl = this.songList[index].filePath
+      }
       this.name = this.songList[index].name
       this.name = this.songList[index].name
       this.artist = this.songList[this.curIndex].artist
       this.artist = this.songList[this.curIndex].artist
       this.curIndex = index;
       this.curIndex = index;
@@ -12940,7 +12961,11 @@ export struct LocalMusic {
     this.CONTROL_PlayStatus = PlayStatus.INIT;
     this.CONTROL_PlayStatus = PlayStatus.INIT;
     this.stop();
     this.stop();
     this.currentSong = this.songList[this.curIndex]
     this.currentSong = this.songList[this.curIndex]
-    this.videoUrl = this.songList[this.curIndex].filePath.replace(/ /g, '%20');
+    if(this.currentSong.type==CommonConstants.TYPE_WEBDAV){
+      this.videoUrl = this.songList[this.curIndex].filePath.replace(/ /g, '%20');
+    }else{
+      this.videoUrl = this.songList[this.curIndex].filePath
+    }
     this.name = this.songList[this.curIndex].name
     this.name = this.songList[this.curIndex].name
     this.artist = this.songList[this.curIndex].artist
     this.artist = this.songList[this.curIndex].artist
     this.changeImageAnimation()
     this.changeImageAnimation()
@@ -12955,7 +12980,11 @@ export struct LocalMusic {
       this.CONTROL_PlayStatus = PlayStatus.INIT;
       this.CONTROL_PlayStatus = PlayStatus.INIT;
       this.stop();
       this.stop();
       this.currentSong = prevSong;
       this.currentSong = prevSong;
-      this.videoUrl = prevSong.filePath.replace(/ /g, '%20');
+      if(this.currentSong.type==CommonConstants.TYPE_WEBDAV){
+        this.videoUrl = prevSong.filePath.replace(/ /g, '%20');
+      }else{
+        this.videoUrl = prevSong.filePath
+      }
       this.cover = prevSong.pixelMapPath
       this.cover = prevSong.pixelMapPath
       this.artist = prevSong.artist
       this.artist = prevSong.artist
       this.name = prevSong.name;
       this.name = prevSong.name;
@@ -12971,7 +13000,11 @@ export struct LocalMusic {
       this.CONTROL_PlayStatus = PlayStatus.INIT;
       this.CONTROL_PlayStatus = PlayStatus.INIT;
       this.stop();
       this.stop();
       this.currentSong = this.songList[this.curIndex];
       this.currentSong = this.songList[this.curIndex];
-      this.videoUrl = this.songList[this.curIndex].filePath.replace(/ /g, '%20');
+      if(this.currentSong.type==CommonConstants.TYPE_WEBDAV){
+        this.videoUrl = this.songList[this.curIndex].filePath.replace(/ /g, '%20');
+      }else{
+        this.videoUrl =  this.songList[this.curIndex].filePath
+      }
       this.artist = this.songList[this.curIndex].artist
       this.artist = this.songList[this.curIndex].artist
       this.name = this.songList[this.curIndex].name;
       this.name = this.songList[this.curIndex].name;
       this.changeImageAnimation()
       this.changeImageAnimation()