mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
handle entry content only if the entry is new
This commit is contained in:
@@ -91,10 +91,8 @@ public class FeedParser {
|
|||||||
entry.setAuthor(FeedUtils.truncate(item.getAuthor(), 128));
|
entry.setAuthor(FeedUtils.truncate(item.getAuthor(), 128));
|
||||||
|
|
||||||
FeedEntryContent content = new FeedEntryContent();
|
FeedEntryContent content = new FeedEntryContent();
|
||||||
content.setContent(FeedUtils.handleContent(getContent(item),
|
content.setContent(getContent(item));
|
||||||
feed.getLink()));
|
content.setTitle(item.getTitle());
|
||||||
content.setTitle(FeedUtils.truncate(FeedUtils.handleContent(
|
|
||||||
item.getTitle(), feed.getLink()), 2048));
|
|
||||||
SyndEnclosure enclosure = (SyndEnclosure) Iterables.getFirst(
|
SyndEnclosure enclosure = (SyndEnclosure) Iterables.getFirst(
|
||||||
item.getEnclosures(), null);
|
item.getEnclosures(), null);
|
||||||
if (enclosure != null) {
|
if (enclosure != null) {
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ import com.commafeed.backend.MetricsBean;
|
|||||||
import com.commafeed.backend.dao.FeedEntryDAO;
|
import com.commafeed.backend.dao.FeedEntryDAO;
|
||||||
import com.commafeed.backend.dao.FeedEntryStatusDAO;
|
import com.commafeed.backend.dao.FeedEntryStatusDAO;
|
||||||
import com.commafeed.backend.dao.FeedSubscriptionDAO;
|
import com.commafeed.backend.dao.FeedSubscriptionDAO;
|
||||||
|
import com.commafeed.backend.feeds.FeedUtils;
|
||||||
import com.commafeed.backend.model.Feed;
|
import com.commafeed.backend.model.Feed;
|
||||||
import com.commafeed.backend.model.FeedEntry;
|
import com.commafeed.backend.model.FeedEntry;
|
||||||
|
import com.commafeed.backend.model.FeedEntryContent;
|
||||||
import com.commafeed.backend.model.FeedEntryStatus;
|
import com.commafeed.backend.model.FeedEntryStatus;
|
||||||
import com.commafeed.backend.model.FeedSubscription;
|
import com.commafeed.backend.model.FeedSubscription;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
@@ -43,6 +45,13 @@ public class FeedUpdateService {
|
|||||||
|
|
||||||
FeedEntry update = null;
|
FeedEntry update = null;
|
||||||
if (foundEntry == null) {
|
if (foundEntry == null) {
|
||||||
|
FeedEntryContent content = entry.getContent();
|
||||||
|
content.setTitle(FeedUtils.truncate(
|
||||||
|
FeedUtils.handleContent(content.getTitle(), feed.getLink()),
|
||||||
|
2048));
|
||||||
|
content.setContent(FeedUtils.handleContent(content.getContent(),
|
||||||
|
feed.getLink()));
|
||||||
|
|
||||||
entry.setInserted(Calendar.getInstance().getTime());
|
entry.setInserted(Calendar.getInstance().getTime());
|
||||||
entry.getFeeds().add(feed);
|
entry.getFeeds().add(feed);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user