mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix(feeds): process RSS on initial run (#918)
This commit is contained in:
parent
b0b98b8d9c
commit
01a69c7582
1 changed files with 2 additions and 11 deletions
|
@ -227,12 +227,6 @@ func (j *RSSJob) getFeed(ctx context.Context) (items []*gofeed.Item, err error)
|
||||||
|
|
||||||
//sort.Sort(feed)
|
//sort.Sort(feed)
|
||||||
|
|
||||||
bucketCount, err := j.CacheRepo.GetCountByBucket(ctx, bucketKey)
|
|
||||||
if err != nil {
|
|
||||||
j.Log.Error().Err(err).Msg("could not check if item exists")
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// set ttl to 1 month
|
// set ttl to 1 month
|
||||||
ttl := time.Now().AddDate(0, 1, 0)
|
ttl := time.Now().AddDate(0, 1, 0)
|
||||||
|
|
||||||
|
@ -264,12 +258,9 @@ func (j *RSSJob) getFeed(ctx context.Context) (items []*gofeed.Item, err error)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// first time we fetch the feed the cached bucket count will be 0
|
// only append if we successfully added to cache
|
||||||
// only append to items if it's bigger than 0, so we get new items only
|
|
||||||
if bucketCount > 0 {
|
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// send to filters
|
// send to filters
|
||||||
return
|
return
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue