mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
no guid and no link, skip entry
This commit is contained in:
@@ -74,8 +74,16 @@ public class FeedParser {
|
||||
for (SyndEntry item : items) {
|
||||
FeedEntry entry = new FeedEntry();
|
||||
|
||||
entry.setGuid(FeedUtils.truncate(item.getUri(), 2048));
|
||||
entry.setGuidHash(DigestUtils.sha1Hex(item.getUri()));
|
||||
String guid = item.getUri();
|
||||
if (StringUtils.isBlank(guid)) {
|
||||
guid = item.getLink();
|
||||
}
|
||||
if (StringUtils.isBlank(guid)) {
|
||||
// no guid and no link, skip entry
|
||||
continue;
|
||||
}
|
||||
entry.setGuid(FeedUtils.truncate(guid, 2048));
|
||||
entry.setGuidHash(DigestUtils.sha1Hex(guid));
|
||||
entry.setUrl(FeedUtils.truncate(
|
||||
FeedUtils.toAbsoluteUrl(item.getLink(), feed.getLink()),
|
||||
2048));
|
||||
|
||||
Reference in New Issue
Block a user