mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 16:40:32 +00:00
This thing actually works lol
This commit is contained in:
parent
0b7593ad28
commit
5150c2ee62
@ -73,6 +73,7 @@ import java.util.Locale;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import icepick.State;
|
||||
import io.reactivex.Flowable;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.Single;
|
||||
@ -406,18 +407,20 @@ public class SubscriptionFragment extends BaseStateFragment<List<SubscriptionEnt
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe((@NonNull ChannelInfo result) -> {
|
||||
new LongOperation().execute(SubscriptionEntity.from(result));
|
||||
new LongOperation().execute(result);
|
||||
}, (@NonNull Throwable throwable) -> {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private class LongOperation extends AsyncTask<SubscriptionEntity, Void, Void> {
|
||||
private class LongOperation extends AsyncTask<ChannelInfo, Void, Void> {
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(SubscriptionEntity... params) {
|
||||
subscriptionService.subscriptionTable().delete(params[0]);
|
||||
protected Void doInBackground(ChannelInfo... params) {
|
||||
ChannelInfo info = params[0];
|
||||
Flowable<List<SubscriptionEntity>> subscription = subscriptionService.subscriptionTable().getSubscription(info.getServiceId(), info.getUrl());
|
||||
subscriptionService.subscriptionTable().delete(subscription.blockingFirst());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user