소스 검색

fixed bug

hjx 1 년 전
부모
커밋
982c4dadd5
1개의 변경된 파일13개의 추가작업 그리고 10개의 파일을 삭제
  1. 13 10
      般若/般若/Home/Music/PlayMusicView/XSBRPlayMusicViewController.m

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

@@ -322,16 +322,19 @@
 }
 
 - (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];
+        }];
+    })
+    
     
 }