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:
ze0s 2024-01-01 17:57:19 +01:00 committed by GitHub
parent 45b522abf8
commit fbabdfb217
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 143 additions and 49 deletions

View file

@ -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),