Explorar o código

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

Felix Paul Kühne %!s(int64=9) %!d(string=hai) anos
pai
achega
278de66d92
Modificáronse 1 ficheiros con 11 adicións e 5 borrados
  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];
 }