index title hash

This commit is contained in:
Athou
2013-07-26 08:15:23 +02:00
parent 6f29af1710
commit 9cdc364fde
6 changed files with 38 additions and 25 deletions

View File

@@ -90,7 +90,7 @@ public class FeedParser {
FeedEntryContent content = new FeedEntryContent();
content.setContent(getContent(item));
content.setTitle(getTitle(item));
content.setAuthor(item.getAuthor());
content.setAuthor(StringUtils.trimToNull(item.getAuthor()));
SyndEnclosure enclosure = (SyndEnclosure) Iterables.getFirst(item.getEnclosures(), null);
if (enclosure != null) {
content.setEnclosureUrl(FeedUtils.truncate(enclosure.getUrl(), 2048));
@@ -187,7 +187,7 @@ public class FeedParser {
} else {
content = StringUtils.join(Collections2.transform(item.getContents(), CONTENT_TO_STRING), SystemUtils.LINE_SEPARATOR);
}
return StringUtils.trimToEmpty(content);
return StringUtils.trimToNull(content);
}
private String getTitle(SyndEntry item) {
@@ -200,7 +200,7 @@ public class FeedParser {
title = "(no title)";
}
}
return title;
return StringUtils.trimToNull(title);
}
@SuppressWarnings("unchecked")

View File

@@ -151,7 +151,7 @@ public class FeedRefreshUpdater {
// lock on content, make sure we are not updating the same entry
// twice at the same time
FeedEntryContent content = entry.getContent();
String key2 = DigestUtils.sha1Hex(content.getContent() + content.getTitle() + content.getAuthor());
String key2 = DigestUtils.sha1Hex(StringUtils.trimToEmpty(content.getContent() + content.getTitle()));
Iterator<Lock> iterator = locks.bulkGet(Arrays.asList(key1, key2)).iterator();
Lock lock1 = iterator.next();