diff options
author | ByteHamster <info@bytehamster.com> | 2018-03-23 15:46:00 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2018-03-23 15:46:00 +0100 |
commit | 5048eb10d2b6ff76df938ae1ae338f8e28043f48 (patch) | |
tree | f43e5f55992eebaabd1284f109e446d9c25a053a /core | |
parent | afb9f7db6abcf8f04d32971e5a4873adee940f10 (diff) | |
download | AntennaPod-5048eb10d2b6ff76df938ae1ae338f8e28043f48.zip |
Use description for shownotes if it is longer than contentEncoded
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java | 12 |
1 files changed, 11 insertions, 1 deletions
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; + } + } }; } |