Use description for shownotes if it is longer than contentEncoded

This commit is contained in:
ByteHamster 2018-03-23 15:46:00 +01:00
parent afb9f7db6a
commit 5048eb10d2
1 changed files with 11 additions and 1 deletions

View File

@ -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;
}
}
};
}