feat(macros): add IndexerName (#1511)

* feat(macros): add IndexerName

* fix: tests

* fix: tests
This commit is contained in:
ze0s 2024-04-16 17:35:17 +02:00 committed by GitHub
parent c43e2c76d6
commit 3c3b47fa10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 310 additions and 235 deletions

View file

@ -26,15 +26,14 @@ var (
)
type RSSJob struct {
Feed *domain.Feed
Name string
IndexerIdentifier string
Log zerolog.Logger
URL string
Repo domain.FeedRepo
CacheRepo domain.FeedCacheRepo
ReleaseSvc release.Service
Timeout time.Duration
Feed *domain.Feed
Name string
Log zerolog.Logger
URL string
Repo domain.FeedRepo
CacheRepo domain.FeedCacheRepo
ReleaseSvc release.Service
Timeout time.Duration
attempts int
errors []error
@ -42,17 +41,16 @@ type RSSJob struct {
JobID int
}
func NewRSSJob(feed *domain.Feed, name string, indexerIdentifier string, log zerolog.Logger, url string, repo domain.FeedRepo, cacheRepo domain.FeedCacheRepo, releaseSvc release.Service, timeout time.Duration) FeedJob {
func NewRSSJob(feed *domain.Feed, name string, log zerolog.Logger, url string, repo domain.FeedRepo, cacheRepo domain.FeedCacheRepo, releaseSvc release.Service, timeout time.Duration) FeedJob {
return &RSSJob{
Feed: feed,
Name: name,
IndexerIdentifier: indexerIdentifier,
Log: log,
URL: url,
Repo: repo,
CacheRepo: cacheRepo,
ReleaseSvc: releaseSvc,
Timeout: timeout,
Feed: feed,
Name: name,
Log: log,
URL: url,
Repo: repo,
CacheRepo: cacheRepo,
ReleaseSvc: releaseSvc,
Timeout: timeout,
}
}
@ -120,7 +118,7 @@ func (j *RSSJob) processItem(item *gofeed.Item) *domain.Release {
}
}
rls := domain.NewRelease(j.IndexerIdentifier)
rls := domain.NewRelease(domain.IndexerMinimal{ID: j.Feed.Indexer.ID, Name: j.Feed.Indexer.Name, Identifier: j.Feed.Indexer.Identifier})
rls.Implementation = domain.ReleaseImplementationRSS
rls.ParseString(item.Title)