From 5048eb10d2b6ff76df938ae1ae338f8e28043f48 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 23 Mar 2018 15:46:00 +0100 Subject: [PATCH] Use description for shownotes if it is longer than contentEncoded --- .../de/danoeh/antennapod/core/feed/FeedItem.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java index a35ead4cd..8a44bedf4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java @@ -373,7 +373,17 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr if (contentEncoded == null || description == null) { DBReader.loadExtraInformationOfFeedItem(FeedItem.this); } - return (!TextUtils.isEmpty(contentEncoded)) ? contentEncoded : description; + if (TextUtils.isEmpty(contentEncoded)) { + return description; + } else if (TextUtils.isEmpty(description)) { + return contentEncoded; + } else { + if (description.length() > 1.25 * contentEncoded.length()) { + return description; + } else { + return contentEncoded; + } + } }; }