diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2023-02-24 22:08:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-24 22:08:59 +0100 |
commit | 8be62b6d0e7b2f5a45b70188dcb4e1891ef2a133 (patch) | |
tree | 232be42dfe1eca8806e4e8a944b552ed47ff1fa3 /app | |
parent | 6d72d7cebf351fb172338f780f91c34f1409085e (diff) | |
download | AntennaPod-8be62b6d0e7b2f5a45b70188dcb4e1891ef2a133.zip |
Always add feeds from opml, even if download fails (#6347)
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/OpmlImportActivity.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportActivity.java index c8d9f9b31..64a6b6632 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportActivity.java @@ -28,7 +28,7 @@ import de.danoeh.antennapod.core.export.opml.OpmlElement; import de.danoeh.antennapod.core.export.opml.OpmlReader; import de.danoeh.antennapod.core.preferences.ThemeSwitcher; -import de.danoeh.antennapod.core.service.download.DownloadRequestCreator; +import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.net.download.serviceinterface.DownloadServiceInterface; import de.danoeh.antennapod.databinding.OpmlSelectionBinding; import de.danoeh.antennapod.model.feed.Feed; @@ -43,6 +43,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** @@ -95,9 +96,12 @@ public class OpmlImportActivity extends AppCompatActivity { continue; } OpmlElement element = readElements.get(checked.keyAt(i)); - Feed feed = new Feed(element.getXmlUrl(), null, element.getText()); - DownloadServiceInterface.get().download(this, false, DownloadRequestCreator.create(feed).build()); + Feed feed = new Feed(element.getXmlUrl(), null, + element.getText() != null ? element.getText() : "Unknown podcast"); + feed.setItems(Collections.emptyList()); + DBTasks.updateFeed(this, feed, false); } + DownloadServiceInterface.get().refreshAllFeeds(this, true); }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) @@ -109,6 +113,7 @@ public class OpmlImportActivity extends AppCompatActivity { startActivity(intent); finish(); }, e -> { + e.printStackTrace(); viewBinding.progressBar.setVisibility(View.GONE); Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show(); }); |