mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(clients): override arr download client by name (#1328)
* feat(clients): override arr client by name * feat(clients): add missing file * feat(clients): add section download client arr
This commit is contained in:
parent
45b522abf8
commit
fbabdfb217
22 changed files with 143 additions and 49 deletions
|
@ -43,11 +43,14 @@ func (s *service) lidarr(ctx context.Context, action *domain.Action, release dom
|
|||
cfg.Password = client.Settings.Basic.Password
|
||||
}
|
||||
|
||||
externalId := 0
|
||||
if client.Settings.ExternalDownloadClientId > 0 {
|
||||
externalId = client.Settings.ExternalDownloadClientId
|
||||
} else if action.ExternalDownloadClientID > 0 {
|
||||
externalId = int(action.ExternalDownloadClientID)
|
||||
externalClientId := client.Settings.ExternalDownloadClientId
|
||||
if action.ExternalDownloadClientID > 0 {
|
||||
externalClientId = int(action.ExternalDownloadClientID)
|
||||
}
|
||||
|
||||
externalClient := client.Settings.ExternalDownloadClient
|
||||
if action.ExternalDownloadClient != "" {
|
||||
externalClient = action.ExternalDownloadClient
|
||||
}
|
||||
|
||||
r := lidarr.Release{
|
||||
|
@ -57,7 +60,8 @@ func (s *service) lidarr(ctx context.Context, action *domain.Action, release dom
|
|||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
DownloadClientId: externalId,
|
||||
DownloadClientId: externalClientId,
|
||||
DownloadClient: externalClient,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
Protocol: string(release.Protocol),
|
||||
PublishDate: time.Now().Format(time.RFC3339),
|
||||
|
|
|
@ -42,11 +42,14 @@ func (s *service) radarr(ctx context.Context, action *domain.Action, release dom
|
|||
cfg.Password = client.Settings.Basic.Password
|
||||
}
|
||||
|
||||
externalId := 0
|
||||
if client.Settings.ExternalDownloadClientId > 0 {
|
||||
externalId = client.Settings.ExternalDownloadClientId
|
||||
} else if action.ExternalDownloadClientID > 0 {
|
||||
externalId = int(action.ExternalDownloadClientID)
|
||||
externalClientId := client.Settings.ExternalDownloadClientId
|
||||
if action.ExternalDownloadClientID > 0 {
|
||||
externalClientId = int(action.ExternalDownloadClientID)
|
||||
}
|
||||
|
||||
externalClient := client.Settings.ExternalDownloadClient
|
||||
if action.ExternalDownloadClient != "" {
|
||||
externalClient = action.ExternalDownloadClient
|
||||
}
|
||||
|
||||
r := radarr.Release{
|
||||
|
@ -56,7 +59,8 @@ func (s *service) radarr(ctx context.Context, action *domain.Action, release dom
|
|||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
DownloadClientId: externalId,
|
||||
DownloadClientId: externalClientId,
|
||||
DownloadClient: externalClient,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
Protocol: string(release.Protocol),
|
||||
PublishDate: time.Now().Format(time.RFC3339),
|
||||
|
|
|
@ -42,11 +42,14 @@ func (s *service) readarr(ctx context.Context, action *domain.Action, release do
|
|||
cfg.Password = client.Settings.Basic.Password
|
||||
}
|
||||
|
||||
externalId := 0
|
||||
if client.Settings.ExternalDownloadClientId > 0 {
|
||||
externalId = client.Settings.ExternalDownloadClientId
|
||||
} else if action.ExternalDownloadClientID > 0 {
|
||||
externalId = int(action.ExternalDownloadClientID)
|
||||
externalClientId := client.Settings.ExternalDownloadClientId
|
||||
if action.ExternalDownloadClientID > 0 {
|
||||
externalClientId = int(action.ExternalDownloadClientID)
|
||||
}
|
||||
|
||||
externalClient := client.Settings.ExternalDownloadClient
|
||||
if action.ExternalDownloadClient != "" {
|
||||
externalClient = action.ExternalDownloadClient
|
||||
}
|
||||
|
||||
r := readarr.Release{
|
||||
|
@ -56,7 +59,8 @@ func (s *service) readarr(ctx context.Context, action *domain.Action, release do
|
|||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
DownloadClientId: externalId,
|
||||
DownloadClientId: externalClientId,
|
||||
DownloadClient: externalClient,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
Protocol: string(release.Protocol),
|
||||
PublishDate: time.Now().Format(time.RFC3339),
|
||||
|
|
|
@ -42,11 +42,14 @@ func (s *service) sonarr(ctx context.Context, action *domain.Action, release dom
|
|||
cfg.Password = client.Settings.Basic.Password
|
||||
}
|
||||
|
||||
externalId := 0
|
||||
if client.Settings.ExternalDownloadClientId > 0 {
|
||||
externalId = client.Settings.ExternalDownloadClientId
|
||||
} else if action.ExternalDownloadClientID > 0 {
|
||||
externalId = int(action.ExternalDownloadClientID)
|
||||
externalClientId := client.Settings.ExternalDownloadClientId
|
||||
if action.ExternalDownloadClientID > 0 {
|
||||
externalClientId = int(action.ExternalDownloadClientID)
|
||||
}
|
||||
|
||||
externalClient := client.Settings.ExternalDownloadClient
|
||||
if action.ExternalDownloadClient != "" {
|
||||
externalClient = action.ExternalDownloadClient
|
||||
}
|
||||
|
||||
r := sonarr.Release{
|
||||
|
@ -56,7 +59,8 @@ func (s *service) sonarr(ctx context.Context, action *domain.Action, release dom
|
|||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
DownloadClientId: externalId,
|
||||
DownloadClientId: externalClientId,
|
||||
DownloadClient: externalClient,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
Protocol: string(release.Protocol),
|
||||
PublishDate: time.Now().Format(time.RFC3339),
|
||||
|
|
|
@ -42,11 +42,14 @@ func (s *service) whisparr(ctx context.Context, action *domain.Action, release d
|
|||
cfg.Password = client.Settings.Basic.Password
|
||||
}
|
||||
|
||||
externalId := 0
|
||||
if client.Settings.ExternalDownloadClientId > 0 {
|
||||
externalId = client.Settings.ExternalDownloadClientId
|
||||
} else if action.ExternalDownloadClientID > 0 {
|
||||
externalId = int(action.ExternalDownloadClientID)
|
||||
externalClientId := client.Settings.ExternalDownloadClientId
|
||||
if action.ExternalDownloadClientID > 0 {
|
||||
externalClientId = int(action.ExternalDownloadClientID)
|
||||
}
|
||||
|
||||
externalClient := client.Settings.ExternalDownloadClient
|
||||
if action.ExternalDownloadClient != "" {
|
||||
externalClient = action.ExternalDownloadClient
|
||||
}
|
||||
|
||||
r := whisparr.Release{
|
||||
|
@ -56,7 +59,8 @@ func (s *service) whisparr(ctx context.Context, action *domain.Action, release d
|
|||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
DownloadClientId: externalId,
|
||||
DownloadClientId: externalClientId,
|
||||
DownloadClient: externalClient,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
Protocol: string(release.Protocol),
|
||||
PublishDate: time.Now().Format(time.RFC3339),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue