浏览代码

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