Skip to content

Commit 064242d

Browse files
committed
Remove unecessary interface InfoCallback
Co-authored-by: Stypox <stypox@pm.me> Replace the unecessary callback interface InfoCallback in favour of the standard type Consumer<SinglePlayQueue>
1 parent 3ff00ff commit 064242d

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import java.util.Collections;
2222
import java.util.List;
23+
import java.util.function.Consumer;
2324

2425
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
2526
import io.reactivex.rxjava3.schedulers.Schedulers;
@@ -214,13 +215,9 @@ private static void openChannelFragment(final Fragment fragment,
214215
// helper functions //
215216
/////////////////////////////////////////////
216217

217-
private interface InfoCallback {
218-
void onInfo(SinglePlayQueue item);
219-
}
220-
221218
private static void fetchItemInfoIfSparse(final Fragment fragment,
222219
final StreamInfoItem item,
223-
final InfoCallback callback) {
220+
final Consumer<SinglePlayQueue> callback) {
224221
if (!(item.getStreamType() == StreamType.LIVE_STREAM
225222
|| item.getStreamType() == StreamType.AUDIO_LIVE_STREAM)
226223
&& item.getDuration() < 0) {
@@ -242,10 +239,10 @@ private static void fetchItemInfoIfSparse(final Fragment fragment,
242239
throwable.toString()))
243240
.subscribe();
244241

245-
callback.onInfo(new SinglePlayQueue(result));
242+
callback.accept(new SinglePlayQueue(result));
246243
}, throwable -> Log.e("StreamDialogEntry", throwable.toString()));
247244
} else {
248-
callback.onInfo(new SinglePlayQueue(item));
245+
callback.accept(new SinglePlayQueue(item));
249246
}
250247
}
251248
}

0 commit comments

Comments
 (0)