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
|
@ -48,7 +48,7 @@ func (s *service) execCmd(ctx context.Context, action *domain.Action, release do
|
|||
|
||||
duration := time.Since(start)
|
||||
|
||||
s.log.Info().Msgf("executed command: '%s', args: '%s' %s,%s, total time %v", cmd, args, release.TorrentName, release.Indexer, duration)
|
||||
s.log.Info().Msgf("executed command: '%s', args: '%s' %s,%s, total time %v", cmd, args, release.TorrentName, release.Indexer.Name, duration)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -81,7 +81,11 @@ func Test_service_execCmd(t *testing.T) {
|
|||
release: domain.Release{
|
||||
TorrentName: "This is a test",
|
||||
TorrentTmpFile: "tmp-10000",
|
||||
Indexer: "mock",
|
||||
Indexer: domain.IndexerMinimal{
|
||||
ID: 0,
|
||||
Name: "Mock Indexer",
|
||||
Identifier: "mock",
|
||||
},
|
||||
},
|
||||
action: &domain.Action{
|
||||
Name: "echo",
|
||||
|
|
|
@ -59,7 +59,7 @@ func (s *service) lidarr(ctx context.Context, action *domain.Action, release dom
|
|||
DownloadUrl: release.DownloadURL,
|
||||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
Indexer: release.Indexer.Identifier,
|
||||
DownloadClientId: externalClientId,
|
||||
DownloadClient: externalClient,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
|
|
|
@ -58,7 +58,7 @@ func (s *service) radarr(ctx context.Context, action *domain.Action, release dom
|
|||
DownloadUrl: release.DownloadURL,
|
||||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
Indexer: release.Indexer.Identifier,
|
||||
DownloadClientId: externalClientId,
|
||||
DownloadClient: externalClient,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
|
|
|
@ -58,7 +58,7 @@ func (s *service) readarr(ctx context.Context, action *domain.Action, release do
|
|||
DownloadUrl: release.DownloadURL,
|
||||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
Indexer: release.Indexer.Identifier,
|
||||
DownloadClientId: externalClientId,
|
||||
DownloadClient: externalClient,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
|
|
|
@ -98,7 +98,7 @@ func (s *service) RunAction(ctx context.Context, action *domain.Action, release
|
|||
Event: domain.NotificationEventPushApproved,
|
||||
ReleaseName: release.TorrentName,
|
||||
Filter: release.FilterName,
|
||||
Indexer: release.Indexer,
|
||||
Indexer: release.Indexer.Name,
|
||||
InfoHash: release.TorrentHash,
|
||||
Size: release.Size,
|
||||
Status: domain.ReleasePushStatusApproved,
|
||||
|
|
|
@ -58,7 +58,7 @@ func (s *service) sonarr(ctx context.Context, action *domain.Action, release dom
|
|||
DownloadUrl: release.DownloadURL,
|
||||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
Indexer: release.Indexer.Identifier,
|
||||
DownloadClientId: externalClientId,
|
||||
DownloadClient: externalClient,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
|
|
|
@ -58,7 +58,7 @@ func (s *service) whisparr(ctx context.Context, action *domain.Action, release d
|
|||
DownloadUrl: release.DownloadURL,
|
||||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
Indexer: release.Indexer.Identifier,
|
||||
DownloadClientId: externalClientId,
|
||||
DownloadClient: externalClient,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue