remove feed key

Former-commit-id: b047d25d19c2861a1283799dd9b38aacebed7638
This commit is contained in:
bel
2019-06-22 13:13:02 -06:00
parent eb356c3339
commit c0c88502c4
5 changed files with 14 additions and 19 deletions

View File

@@ -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
}