remove feed key
Former-commit-id: b047d25d19c2861a1283799dd9b38aacebed7638
This commit is contained in:
10
rss/item.go
10
rss/item.go
@@ -21,16 +21,14 @@ type Item struct {
|
||||
Link string
|
||||
Content string
|
||||
TS time.Time
|
||||
FeedKey string
|
||||
}
|
||||
|
||||
func newItem(i *gofeed.Item, contentFilter, feedKey string) (*Item, error) {
|
||||
func newItem(i *gofeed.Item, contentFilter string) (*Item, error) {
|
||||
item := &Item{
|
||||
Title: i.Title,
|
||||
Link: i.Link,
|
||||
Content: i.Content,
|
||||
TS: latestTSPtr(i.UpdatedParsed, i.PublishedParsed),
|
||||
FeedKey: feedKey,
|
||||
}
|
||||
|
||||
if item.Content == "" {
|
||||
@@ -76,15 +74,15 @@ func (i *Item) save() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return db.Set(i.Link, b, nsItems, i.FeedKey)
|
||||
return db.Set(i.Link, b, nsItems)
|
||||
}
|
||||
|
||||
func (i *Item) load() error {
|
||||
if i.Link == "" || i.FeedKey == "" {
|
||||
if i.Link == "" {
|
||||
return errors.New("cannot load nil item")
|
||||
}
|
||||
db := config.Values().DB
|
||||
b, err := db.Get(i.Link, nsItems, i.FeedKey)
|
||||
b, err := db.Get(i.Link, nsItems)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user