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];
+        }];
+    })
+    
     
 }