detail view: fallback to media description if body is empty
Signed-off-by: David Luhmer <david-dev@live.de>
This commit is contained in:
parent
1789642a61
commit
7757eb24d9
2 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue