diff options
author | malockin <malockin@gmail.com> | 2020-05-03 18:17:42 +0300 |
---|---|---|
committer | malockin <malockin@gmail.com> | 2020-05-03 18:17:42 +0300 |
commit | 4f8979ecacbb7f7c8c2a854bc6f2c98f5f89f5cf (patch) | |
tree | eaaf95e6380aecac6581b0e22e344ef682c0a7fb /core/src/main/java | |
parent | f634198794ee3e15fc02f677da1642c7df0f5271 (diff) | |
download | AntennaPod-4f8979ecacbb7f7c8c2a854bc6f2c98f5f89f5cf.zip |
Reformatted output, added Hebrew translation
Reformatted output to be sorted by date in descending order. Added links
to episode page, as well as direct media download.
Added Hebrew transaltion for Favorites export.
Removed unused code.
Diffstat (limited to 'core/src/main/java')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/export/favorites/FavoritesWriter.java | 20 |
1 files changed, 10 insertions, 10 deletions
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 a6686a8a4..39e968ce9 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 @@ -35,7 +35,7 @@ public class FavoritesWriter implements ExportWriter { String template = IOUtils.toString(templateStream, "UTF-8"); String[] templateParts = template.split("\\{FAVORITES\\}"); - Map<Long, List<FeedItem>> favoriteByFeed = getFeedMap(getFavorites(feeds)); + Map<Long, List<FeedItem>> favoriteByFeed = getFeedMap(getFavorites()); writer.append(templateParts[0]); writer.append("<ul>"); @@ -60,7 +60,7 @@ public class FavoritesWriter implements ExportWriter { Log.d(TAG, "Finished writing document"); } - private List<FeedItem> getFavorites(List<Feed> feeds) { + private List<FeedItem> getFavorites() { int page = 0; List<FeedItem> favoritesPage = DBReader.getFavoriteItemsList(page, PAGE_LIMIT); @@ -79,7 +79,8 @@ public class FavoritesWriter implements ExportWriter { favoritesPage = DBReader.getFavoriteItemsList(page * PAGE_LIMIT, PAGE_LIMIT); } - Collections.sort(favoritesList, (lhs, rhs) -> lhs.getPubDate().compareTo(rhs.getPubDate())); + // sort in descending order + Collections.sort(favoritesList, (lhs, rhs) -> rhs.getPubDate().compareTo(lhs.getPubDate())); return favoritesList; } @@ -114,14 +115,13 @@ public class FavoritesWriter implements ExportWriter { } private void writeFavoriteItem(Writer writer, FeedItem item) throws IOException { - writer.append("<li><span>["); - writer.append(DATE_FORMAT.format(item.getPubDate())); - writer.append("] <a href=\""); - writer.append(item.getLink()); - writer.append("\">"); + writer.append("<li><span>"); writer.append(item.getTitle().trim()); - writer.append("</a>"); - writer.append("</span></li>\n"); + writer.append("<br>\n[<a href=\""); + writer.append(item.getLink()); + writer.append("\">Website</a>] • [<a href=\""); + writer.append(item.getMedia().getDownload_url()); + writer.append("\">Media</a>]</span></li>\n"); } @Override |