Skip to content

Commit b5fa93e

Browse files
committed
Fix SparseItemUtil loading
* Added a missing `return` statement * `fetchUploaderUrlIfSparse` now has a similar layout to `fetchItemInfoIfSparse`
1 parent 1ecb0ca commit b5fa93e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

app/src/main/java/org/schabi/newpipe/util/SparseItemUtil.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public static void fetchItemInfoIfSparse(@NonNull final Context context,
5454
// if the duration is >= 0 (provided that the item is not a livestream) and there is an
5555
// uploader url, probably all info is already there, so there is no need to fetch it
5656
callback.accept(new SinglePlayQueue(item));
57+
return;
5758
}
5859

5960
// either the duration or the uploader url are not available, so fetch more info
@@ -80,12 +81,12 @@ public static void fetchUploaderUrlIfSparse(@NonNull final Context context,
8081
@NonNull final String url,
8182
@Nullable final String uploaderUrl,
8283
@NonNull final Consumer<String> callback) {
83-
if (isNullOrEmpty(uploaderUrl)) {
84-
fetchStreamInfoAndSaveToDatabase(context, serviceId, url,
85-
streamInfo -> callback.accept(streamInfo.getUploaderUrl()));
86-
} else {
84+
if (!isNullOrEmpty(uploaderUrl)) {
8785
callback.accept(uploaderUrl);
86+
return;
8887
}
88+
fetchStreamInfoAndSaveToDatabase(context, serviceId, url,
89+
streamInfo -> callback.accept(streamInfo.getUploaderUrl()));
8990
}
9091

9192
/**

0 commit comments

Comments
 (0)