detail view: fallback to media description if body is empty

Signed-off-by: David Luhmer <david-dev@live.de>
This commit is contained in:
David Luhmer 2020-07-23 17:14:17 +02:00
parent 1789642a61
commit 7757eb24d9
2 changed files with 5 additions and 2 deletions

View file

@ -163,8 +163,6 @@ public class NewsListRecyclerAdapter extends RecyclerView.Adapter {
layout = R.layout.subscription_detail_list_item_thumbnail;
break;
case 1:
layout = R.layout.subscription_detail_list_item_text;
break;
case 3:
layout = R.layout.subscription_detail_list_item_text;
break;

View file

@ -125,6 +125,11 @@ public class RssItemToHtmlTask extends AsyncTask<Void, Void, String> {
}
String description = rssItem.getBody();
if(description.isEmpty() && rssItem.getMediaDescription() != null) {
// in case the rss body is empty, fallback to the media description (e.g. youtube / ted talks)
description = rssItem.getMediaDescription();
}
if(!incognitoMode) {
// If incognito mode is disabled, try getting images from cache
description = getDescriptionWithCachedImages(description).trim();