Fix PlaylistAppendDialog: Renamed method and replaced with Runnable
This commit is contained in:
parent
0f720b6e97
commit
d7547fb196
4 changed files with 7 additions and 11 deletions
|
|
@ -40,8 +40,8 @@ public final class PlaylistAppendDialog extends PlaylistDialog {
|
|||
|
||||
private CompositeDisposable playlistDisposables = new CompositeDisposable();
|
||||
|
||||
public static Disposable checkPlaylists(
|
||||
final Context context, final Invoker onSuccess, final Invoker onFailed
|
||||
public static Disposable onPlaylistFound(
|
||||
final Context context, final Runnable onSuccess, final Runnable onFailed
|
||||
) {
|
||||
final LocalPlaylistManager playlistManager =
|
||||
new LocalPlaylistManager(NewPipeDatabase.getInstance(context));
|
||||
|
|
@ -50,17 +50,13 @@ public final class PlaylistAppendDialog extends PlaylistDialog {
|
|||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(hasPlaylists -> {
|
||||
if (hasPlaylists) {
|
||||
onSuccess.invoke();
|
||||
onSuccess.run();
|
||||
} else {
|
||||
onFailed.invoke();
|
||||
onFailed.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface Invoker {
|
||||
void invoke();
|
||||
}
|
||||
|
||||
public static PlaylistAppendDialog fromStreamInfo(final StreamInfo info) {
|
||||
final PlaylistAppendDialog dialog = new PlaylistAppendDialog();
|
||||
dialog.setInfo(Collections.singletonList(new StreamEntity(info)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue