forked from Archives/Athou_commafeed
move author to content
This commit is contained in:
@@ -5,7 +5,6 @@ import java.text.DateFormat;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.lang.SystemUtils;
|
import org.apache.commons.lang.SystemUtils;
|
||||||
import org.jdom.Element;
|
import org.jdom.Element;
|
||||||
@@ -89,16 +88,15 @@ public class FeedParser {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
entry.setGuid(FeedUtils.truncate(guid, 2048));
|
entry.setGuid(FeedUtils.truncate(guid, 2048));
|
||||||
entry.setGuidHash(DigestUtils.sha1Hex(guid));
|
|
||||||
entry.setUrl(FeedUtils.truncate(
|
entry.setUrl(FeedUtils.truncate(
|
||||||
FeedUtils.toAbsoluteUrl(item.getLink(), feed.getLink()),
|
FeedUtils.toAbsoluteUrl(item.getLink(), feed.getLink()),
|
||||||
2048));
|
2048));
|
||||||
entry.setUpdated(validateDate(getEntryUpdateDate(item), true));
|
entry.setUpdated(validateDate(getEntryUpdateDate(item), true));
|
||||||
entry.setAuthor(item.getAuthor());
|
|
||||||
|
|
||||||
FeedEntryContent content = new FeedEntryContent();
|
FeedEntryContent content = new FeedEntryContent();
|
||||||
content.setContent(getContent(item));
|
content.setContent(getContent(item));
|
||||||
content.setTitle(getTitle(item));
|
content.setTitle(getTitle(item));
|
||||||
|
content.setAuthor(item.getAuthor());
|
||||||
SyndEnclosure enclosure = (SyndEnclosure) Iterables.getFirst(
|
SyndEnclosure enclosure = (SyndEnclosure) Iterables.getFirst(
|
||||||
item.getEnclosures(), null);
|
item.getEnclosures(), null);
|
||||||
if (enclosure != null) {
|
if (enclosure != null) {
|
||||||
|
|||||||
@@ -43,9 +43,6 @@ public class FeedEntry extends AbstractModel {
|
|||||||
@Column(length = 2048)
|
@Column(length = 2048)
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
@Column(name = "author", length = 128)
|
|
||||||
private String author;
|
|
||||||
|
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date inserted;
|
private Date inserted;
|
||||||
|
|
||||||
@@ -117,14 +114,6 @@ public class FeedEntry extends AbstractModel {
|
|||||||
this.guidHash = guidHash;
|
this.guidHash = guidHash;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAuthor() {
|
|
||||||
return author;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuthor(String author) {
|
|
||||||
this.author = author;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Feed getFeed() {
|
public Feed getFeed() {
|
||||||
return feed;
|
return feed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class Entry implements Serializable {
|
|||||||
entry.setContent(FeedUtils.proxyImages(feedEntry.getContent()
|
entry.setContent(FeedUtils.proxyImages(feedEntry.getContent()
|
||||||
.getContent(), publicUrl, proxyImages));
|
.getContent(), publicUrl, proxyImages));
|
||||||
entry.setRtl(FeedUtils.isRTL(feedEntry));
|
entry.setRtl(FeedUtils.isRTL(feedEntry));
|
||||||
entry.setAuthor(feedEntry.getAuthor());
|
entry.setAuthor(feedEntry.getContent().getAuthor());
|
||||||
entry.setEnclosureUrl(feedEntry.getContent().getEnclosureUrl());
|
entry.setEnclosureUrl(feedEntry.getContent().getEnclosureUrl());
|
||||||
entry.setEnclosureType(feedEntry.getContent().getEnclosureType());
|
entry.setEnclosureType(feedEntry.getContent().getEnclosureType());
|
||||||
entry.setDate(feedEntry.getUpdated());
|
entry.setDate(feedEntry.getUpdated());
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
<createIndex tableName="FEEDENTRYCONTENTS" indexName="content_hash_index">
|
<createIndex tableName="FEEDENTRYCONTENTS" indexName="content_hash_index">
|
||||||
<column name="contentHash" />
|
<column name="contentHash" />
|
||||||
</createIndex>
|
</createIndex>
|
||||||
|
<dropColumn tableName="FEEDENTRIES" columnName="author"/>
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
|
||||||
<changeSet author="athou" id="add-new-index">
|
<changeSet author="athou" id="add-new-index">
|
||||||
|
|||||||
Reference in New Issue
Block a user