summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-09-08 15:49:38 +0200
committerGitHub <noreply@github.com>2024-09-08 15:49:38 +0200
commit8961405d5d7c8e36d6e410aeb2017d38f317248b (patch)
tree4fe07753be2704f872d8ff451093ed9f52a16445
parent5ea92f68b1cd964f42a0c621d81ea873ca73e75d (diff)
downloadAntennaPod-8961405d5d7c8e36d6e410aeb2017d38f317248b.zip
Fix subscribing with discovery dialog (#7391)
-rw-r--r--app/src/main/java/de/danoeh/antennapod/ui/screen/onlinefeedview/OnlineFeedViewActivity.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/ui/screen/onlinefeedview/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/ui/screen/onlinefeedview/OnlineFeedViewActivity.java
index 7e994b1ed..952c4f157 100644
--- a/app/src/main/java/de/danoeh/antennapod/ui/screen/onlinefeedview/OnlineFeedViewActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/ui/screen/onlinefeedview/OnlineFeedViewActivity.java
@@ -279,8 +279,12 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
private void parseFeed(String destination) {
Log.d(TAG, "Parsing feed");
- parser = Observable.fromCallable(() -> {
+ parser = Maybe.<Long>create(emitter -> {
FeedHandlerResult handlerResult = doParseFeed(destination);
+ if (handlerResult == null) { // Started another attempt with another url
+ emitter.onComplete();
+ return;
+ }
Feed feed = handlerResult.feed;
feed.setState(Feed.STATE_NOT_SUBSCRIBED);
feed.setLastRefreshAttempt(System.currentTimeMillis());
@@ -288,7 +292,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
Feed feedFromDb = DBReader.getFeed(feed.getId(), false, 0, Integer.MAX_VALUE);
feedFromDb.getPreferences().setKeepUpdated(false);
DBWriter.setFeedPreferences(feedFromDb.getPreferences());
- return feed.getId();
+ emitter.onSuccess(feed.getId());
})
.subscribeOn(Schedulers.computation())
.observeOn(AndroidSchedulers.mainThread())