From cc98447af95faf7f5d44130069edd0dbeeb2ae8c Mon Sep 17 00:00:00 2001 From: malockin Date: Sun, 24 May 2020 08:13:27 +0300 Subject: [PATCH] Use replace instread of replaceAll & fix typo --- ... => html-export-favorites-item-template.html} | 0 .../core/export/favorites/FavoritesWriter.java | 16 ++++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) rename core/src/main/assets/{html-export-fatorites-item-template.html => html-export-favorites-item-template.html} (100%) diff --git a/core/src/main/assets/html-export-fatorites-item-template.html b/core/src/main/assets/html-export-favorites-item-template.html similarity index 100% rename from core/src/main/assets/html-export-fatorites-item-template.html rename to core/src/main/assets/html-export-favorites-item-template.html diff --git a/core/src/main/java/de/danoeh/antennapod/core/export/favorites/FavoritesWriter.java b/core/src/main/java/de/danoeh/antennapod/core/export/favorites/FavoritesWriter.java index 914faca05..60c38a391 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/export/favorites/FavoritesWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/export/favorites/FavoritesWriter.java @@ -25,7 +25,7 @@ public class FavoritesWriter implements ExportWriter { private static final int PAGE_LIMIT = 100; - private static final String FAVORITE_TEMPLATE = "html-export-fatorites-item-template.html"; + private static final String FAVORITE_TEMPLATE = "html-export-favorites-item-template.html"; private static final String FEED_TEMPLATE = "html-export-feed-template.html"; private static final String UTF_8 = "UTF-8"; @@ -108,19 +108,19 @@ public class FavoritesWriter implements ExportWriter { private void writeFeed(Writer writer, Feed feed, String feedTemplate) throws IOException { String feedInfo = feedTemplate - .replaceAll("\\{FEED_IMG\\}", feed.getImageUrl()) - .replaceAll("\\{FEED_TITLE\\}", feed.getTitle()) - .replaceAll("\\{FEED_LINK\\}", feed.getLink()) - .replaceAll("\\{FEED_WEBSITE\\}", feed.getDownload_url()); + .replace("{FEED_IMG}", feed.getImageUrl()) + .replace("{FEED_TITLE}", feed.getTitle()) + .replace("{FEED_LINK}", feed.getLink()) + .replace("{FEED_WEBSITE}", feed.getDownload_url()); writer.append(feedInfo); } private void writeFavoriteItem(Writer writer, FeedItem item, String favoriteTemplate) throws IOException { String favItem = favoriteTemplate - .replaceAll("\\{FAV_TITLE\\}", item.getTitle().trim()) - .replaceAll("\\{FAV_WEBSITE\\}", item.getLink()) - .replaceAll("\\{FAV_MEDIA\\}", item.getMedia().getDownload_url()); + .replace("{FAV_TITLE}", item.getTitle().trim()) + .replace("{FAV_WEBSITE}", item.getLink()) + .replace("{FAV_MEDIA}", item.getMedia().getDownload_url()); writer.append(favItem); }