mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(downloadclient): set downloadClientId for arr clients (#1081)
feat(downloadclient): arrs set downloadClientId
This commit is contained in:
parent
1bfbe38335
commit
0d3e10f094
22 changed files with 154 additions and 66 deletions
|
@ -42,19 +42,28 @@ func (s *service) radarr(ctx context.Context, action *domain.Action, release dom
|
|||
cfg.Password = client.Settings.Basic.Password
|
||||
}
|
||||
|
||||
arr := radarr.New(cfg)
|
||||
externalId := 0
|
||||
if client.Settings.ExternalDownloadClientId > 0 {
|
||||
externalId = client.Settings.ExternalDownloadClientId
|
||||
} else if action.ExternalDownloadClientID > 0 {
|
||||
externalId = int(action.ExternalDownloadClientID)
|
||||
}
|
||||
|
||||
r := radarr.Release{
|
||||
Title: release.TorrentName,
|
||||
InfoUrl: release.InfoURL,
|
||||
DownloadUrl: release.DownloadURL,
|
||||
MagnetUrl: release.MagnetURI,
|
||||
Size: int64(release.Size),
|
||||
Indexer: release.Indexer,
|
||||
DownloadClientId: externalId,
|
||||
DownloadProtocol: string(release.Protocol),
|
||||
Protocol: string(release.Protocol),
|
||||
PublishDate: time.Now().Format(time.RFC3339),
|
||||
}
|
||||
|
||||
arr := radarr.New(cfg)
|
||||
|
||||
rejections, err := arr.Push(ctx, r)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "radarr failed to push release: %v", r)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue