proxy images through commafeed (#231)

This commit is contained in:
Athou
2013-06-22 21:36:55 +02:00
parent ab51b63b39
commit 52e4a2a0b7
10 changed files with 118 additions and 8 deletions

View File

@@ -24,7 +24,8 @@ import com.wordnik.swagger.annotations.ApiProperty;
@ApiClass("Entry details")
public class Entry implements Serializable {
public static Entry build(FeedEntryStatus status, String publicUrl) {
public static Entry build(FeedEntryStatus status, String publicUrl,
boolean proxyImages) {
Entry entry = new Entry();
FeedEntry feedEntry = status.getEntry();
@@ -36,7 +37,8 @@ public class Entry implements Serializable {
entry.setId(String.valueOf(feedEntry.getId()));
entry.setGuid(feedEntry.getGuid());
entry.setTitle(feedEntry.getContent().getTitle());
entry.setContent(feedEntry.getContent().getContent());
entry.setContent(FeedUtils.proxyImages(feedEntry.getContent()
.getContent(), publicUrl, proxyImages));
entry.setRtl(FeedUtils.isRTL(feedEntry));
entry.setAuthor(feedEntry.getAuthor());
entry.setEnclosureUrl(feedEntry.getContent().getEnclosureUrl());