소스 검색

server browsing cell: correctly fallback on backdrop image if we don't have a poster

Felix Paul Kühne 9 년 전
부모
커밋
278de66d92
1개의 변경된 파일11개의 추가작업 그리고 5개의 파일을 삭제
  1. 11 5
      VLC for Apple TV/VLCServerBrowsingTVCell.m

+ 11 - 5
VLC for Apple TV/VLCServerBrowsingTVCell.m

@@ -119,15 +119,18 @@ NSString *const VLCServerBrowsingTVCellIdentifier = @"VLCServerBrowsingTVCell";
     }
 
     NSString *imagePath = details.posterPath;
-    if (!imagePath)
+    NSString *imageSize = sessionManager.posterSizes.firstObject;
+    if (!imagePath) {
         imagePath = details.backdropPath;
+        imageSize = sessionManager.backdropSizes.firstObject;
+    }
     if (!imagePath)
         return;
 
     NSString *thumbnailURLString = [NSString stringWithFormat:@"%@%@%@",
                                     sessionManager.imageBaseURL,
                                     sessionManager.posterSizes.firstObject,
-                                    details.posterPath];
+                                    imagePath];
     self.thumbnailURL = [NSURL URLWithString:thumbnailURLString];
 }
 
@@ -146,15 +149,18 @@ NSString *const VLCServerBrowsingTVCellIdentifier = @"VLCServerBrowsingTVCell";
         return;
 
     NSString *imagePath = details.posterPath;
-    if (!imagePath)
+    NSString *imageSize = sessionManager.posterSizes.firstObject;
+    if (!imagePath) {
         imagePath = details.backdropPath;
+        imageSize = sessionManager.backdropSizes.firstObject;
+    }
     if (!imagePath)
         return;
 
     NSString *thumbnailURLString = [NSString stringWithFormat:@"%@%@%@",
                                     sessionManager.imageBaseURL,
-                                    sessionManager.posterSizes.firstObject,
-                                    details.posterPath];
+                                    imageSize,
+                                    imagePath];
     self.thumbnailURL = [NSURL URLWithString:thumbnailURLString];
 }