mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(macros): add IndexerName
(#1511)
* feat(macros): add IndexerName * fix: tests * fix: tests
This commit is contained in:
parent
c43e2c76d6
commit
3c3b47fa10
37 changed files with 310 additions and 235 deletions
|
@ -19,16 +19,15 @@ import (
|
|||
)
|
||||
|
||||
type NewznabJob struct {
|
||||
Feed *domain.Feed
|
||||
Name string
|
||||
IndexerIdentifier string
|
||||
Log zerolog.Logger
|
||||
URL string
|
||||
Client newznab.Client
|
||||
Repo domain.FeedRepo
|
||||
CacheRepo domain.FeedCacheRepo
|
||||
ReleaseSvc release.Service
|
||||
SchedulerSvc scheduler.Service
|
||||
Feed *domain.Feed
|
||||
Name string
|
||||
Log zerolog.Logger
|
||||
URL string
|
||||
Client newznab.Client
|
||||
Repo domain.FeedRepo
|
||||
CacheRepo domain.FeedCacheRepo
|
||||
ReleaseSvc release.Service
|
||||
SchedulerSvc scheduler.Service
|
||||
|
||||
attempts int
|
||||
errors []error
|
||||
|
@ -36,17 +35,16 @@ type NewznabJob struct {
|
|||
JobID int
|
||||
}
|
||||
|
||||
func NewNewznabJob(feed *domain.Feed, name string, indexerIdentifier string, log zerolog.Logger, url string, client newznab.Client, repo domain.FeedRepo, cacheRepo domain.FeedCacheRepo, releaseSvc release.Service) FeedJob {
|
||||
func NewNewznabJob(feed *domain.Feed, name string, log zerolog.Logger, url string, client newznab.Client, repo domain.FeedRepo, cacheRepo domain.FeedCacheRepo, releaseSvc release.Service) FeedJob {
|
||||
return &NewznabJob{
|
||||
Feed: feed,
|
||||
Name: name,
|
||||
IndexerIdentifier: indexerIdentifier,
|
||||
Log: log,
|
||||
URL: url,
|
||||
Client: client,
|
||||
Repo: repo,
|
||||
CacheRepo: cacheRepo,
|
||||
ReleaseSvc: releaseSvc,
|
||||
Feed: feed,
|
||||
Name: name,
|
||||
Log: log,
|
||||
URL: url,
|
||||
Client: client,
|
||||
Repo: repo,
|
||||
CacheRepo: cacheRepo,
|
||||
ReleaseSvc: releaseSvc,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,12 +95,12 @@ func (j *NewznabJob) process(ctx context.Context) error {
|
|||
}
|
||||
}
|
||||
|
||||
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.ReleaseImplementationNewznab
|
||||
rls.Protocol = domain.ReleaseProtocolNzb
|
||||
|
||||
rls.TorrentName = item.Title
|
||||
rls.InfoURL = item.GUID
|
||||
rls.Implementation = domain.ReleaseImplementationNewznab
|
||||
rls.Protocol = domain.ReleaseProtocolNzb
|
||||
|
||||
// parse size bytes string
|
||||
rls.ParseSizeBytesString(item.Size)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue