summaryrefslogtreecommitdiff
path: root/app/src/androidTest/java/de/test/antennapod/util
diff options
context:
space:
mode:
authorTony Tam <149837+tonytamsf@users.noreply.github.com>2021-04-06 09:15:14 -0700
committerGitHub <noreply@github.com>2021-04-06 18:15:14 +0200
commit79c79efce588b446cf9816a01e0056e7e3dfd9db (patch)
treefaa91fbd058c9fb93a827f68dac4062de3c0b04d /app/src/androidTest/java/de/test/antennapod/util
parentef41704166cc17b95159a891e7be36c8b334b8b4 (diff)
downloadAntennaPod-79c79efce588b446cf9816a01e0056e7e3dfd9db.zip
Parsing podcast:funding tag, showing payment, funding links on the show info screen (#4933)
Diffstat (limited to 'app/src/androidTest/java/de/test/antennapod/util')
-rw-r--r--app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java
index a9a6f91e7..be2251062 100644
--- a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java
+++ b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/Rss2Generator.java
@@ -6,9 +6,12 @@ import org.xmlpull.v1.XmlSerializer;
import java.io.IOException;
import java.io.OutputStream;
+import java.util.ArrayList;
import de.danoeh.antennapod.core.feed.Feed;
+import de.danoeh.antennapod.core.feed.FeedFunding;
import de.danoeh.antennapod.core.feed.FeedItem;
+import de.danoeh.antennapod.core.syndication.namespace.PodcastIndex;
import de.danoeh.antennapod.core.util.DateUtils;
/**
@@ -66,8 +69,11 @@ public class Rss2Generator implements FeedGenerator {
xml.endTag(null, "image");
}
- if (feed.getPaymentLink() != null) {
- GeneratorUtil.addPaymentLink(xml, feed.getPaymentLink(), true);
+ ArrayList<FeedFunding> fundingList = feed.getPaymentLinks();
+ if (fundingList != null) {
+ for (FeedFunding funding: fundingList) {
+ GeneratorUtil.addPaymentLink(xml, funding.url, true);
+ }
}
// Write FeedItem data
@@ -107,8 +113,14 @@ public class Rss2Generator implements FeedGenerator {
xml.attribute(null, "type", item.getMedia().getMime_type());
xml.endTag(null, "enclosure");
}
- if (item.getPaymentLink() != null) {
- GeneratorUtil.addPaymentLink(xml, item.getPaymentLink(), true);
+ if (fundingList != null) {
+ for (FeedFunding funding: fundingList) {
+ xml.startTag(PodcastIndex.NSTAG, "funding");
+ xml.attribute(PodcastIndex.NSTAG, "url", funding.url);
+ xml.text(funding.content);
+ GeneratorUtil.addPaymentLink(xml, funding.url, true);
+ xml.endTag(PodcastIndex.NSTAG, "funding");
+ }
}
xml.endTag(null, "item");