Browse Source

fixed bug

hjx 1 year ago
parent
commit
982c4dadd5
1 changed files with 13 additions and 10 deletions
  1. 13 10
      般若/般若/Home/Music/PlayMusicView/XSBRPlayMusicViewController.m

+ 13 - 10
般若/般若/Home/Music/PlayMusicView/XSBRPlayMusicViewController.m

@@ -322,16 +322,19 @@
 }
 }
 
 
 - (void)refreshPlayView {
 - (void)refreshPlayView {
-    if (xsbr_buddhisMusicPlayer().xsbr_musicListArray.count == 0) {
-        return;
-    }
-    [self refreshPlayViewIsPlay:xsbr_buddhisMusicPlayer().xsbr_isPlaying];
-    XSBRMusicItemModel *model = xsbr_buddhisMusicPlayer().xsbr_musicListArray[xsbr_buddhisMusicPlayer().xsbr_currentIndex];
-    [_lyricViewController reloadData:model];
-    @weakify(self)
-    [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:model.xsbr_imgPath] options:0 progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
-        [weak_self handleBackgroundImage:image musicId:model.xsbr_musicId];
-    }];
+    dispatch_main_async_safe(^{
+        if (xsbr_buddhisMusicPlayer().xsbr_musicListArray.count == 0) {
+            return;
+        }
+        [self refreshPlayViewIsPlay:xsbr_buddhisMusicPlayer().xsbr_isPlaying];
+        XSBRMusicItemModel *model = xsbr_buddhisMusicPlayer().xsbr_musicListArray[xsbr_buddhisMusicPlayer().xsbr_currentIndex];
+        [self->_lyricViewController reloadData:model];
+        @weakify(self)
+        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:model.xsbr_imgPath] options:0 progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
+            [weak_self handleBackgroundImage:image musicId:model.xsbr_musicId];
+        }];
+    })
+    
     
     
 }
 }