mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(feeds): implement max_age for torznab/newznab (#763)
* fix(nab): Implement max_age for torznab/newznab * continue newznab * continue torznab
This commit is contained in:
parent
9fed6b3735
commit
5836fcee63
2 changed files with 18 additions and 2 deletions
|
@ -75,8 +75,16 @@ func (j *NewznabJob) process(ctx context.Context) error {
|
|||
}
|
||||
|
||||
releases := make([]*domain.Release, 0)
|
||||
|
||||
now := time.Now()
|
||||
for _, item := range items {
|
||||
if j.Feed.MaxAge > 0 {
|
||||
if item.PubDate.After(time.Date(1970, time.April, 1, 0, 0, 0, 0, time.UTC)) {
|
||||
if !isNewerThanMaxAge(j.Feed.MaxAge, item.PubDate.Time, now) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rls := domain.NewRelease(j.IndexerIdentifier)
|
||||
|
||||
rls.TorrentName = item.Title
|
||||
|
|
|
@ -76,8 +76,16 @@ func (j *TorznabJob) process(ctx context.Context) error {
|
|||
}
|
||||
|
||||
releases := make([]*domain.Release, 0)
|
||||
|
||||
now := time.Now()
|
||||
for _, item := range items {
|
||||
if j.Feed.MaxAge > 0 {
|
||||
if item.PubDate.After(time.Date(1970, time.April, 1, 0, 0, 0, 0, time.UTC)) {
|
||||
if !isNewerThanMaxAge(j.Feed.MaxAge, item.PubDate.Time, now) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rls := domain.NewRelease(j.IndexerIdentifier)
|
||||
|
||||
rls.TorrentName = item.Title
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue