File tree Expand file tree Collapse file tree
extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ public String getName() {
6666 return playlist .getString ("title" );
6767 }
6868
69+ @ Nullable
6970 @ Override
7071 public String getThumbnailUrl () {
7172 String artworkUrl = playlist .getString ("artwork_url" );
@@ -75,21 +76,20 @@ public String getThumbnailUrl() {
7576 // if it also fails, return null
7677 try {
7778 final InfoItemsPage <StreamInfoItem > infoItems = getInitialPage ();
78- if (infoItems .getItems ().isEmpty ()) return null ;
7979
8080 for (StreamInfoItem item : infoItems .getItems ()) {
81- final String thumbnailUrl = item .getThumbnailUrl ();
82- if (thumbnailUrl == null || thumbnailUrl .isEmpty ()) continue ;
83-
84- String thumbnailUrlBetterResolution = thumbnailUrl .replace ("large.jpg" , "crop.jpg" );
85- return thumbnailUrlBetterResolution ;
81+ artworkUrl = item .getThumbnailUrl ();
82+ if (artworkUrl != null && !artworkUrl .isEmpty ()) break ;
8683 }
8784 } catch (Exception ignored ) {
8885 }
86+
87+ if (artworkUrl == null ) {
88+ return null ;
89+ }
8990 }
9091
91- String artworkUrlBetterResolution = artworkUrl .replace ("large.jpg" , "crop.jpg" );
92- return artworkUrlBetterResolution ;
92+ return artworkUrl .replace ("large.jpg" , "crop.jpg" );
9393 }
9494
9595 @ Override
You can’t perform that action at this time.
0 commit comments