mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
Feature: Lidarr (#15)
* feat(web): add lidarr download client * feat: add lidarr download client
This commit is contained in:
parent
fce6c7149a
commit
e6cfc77e85
16 changed files with 582 additions and 15 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/autobrr/autobrr/internal/domain"
|
||||
"github.com/autobrr/autobrr/pkg/lidarr"
|
||||
"github.com/autobrr/autobrr/pkg/qbittorrent"
|
||||
"github.com/autobrr/autobrr/pkg/radarr"
|
||||
"github.com/autobrr/autobrr/pkg/sonarr"
|
||||
|
@ -25,6 +26,9 @@ func (s *service) testConnection(client domain.DownloadClient) error {
|
|||
|
||||
case domain.DownloadClientTypeSonarr:
|
||||
return s.testSonarrConnection(client)
|
||||
|
||||
case domain.DownloadClientTypeLidarr:
|
||||
return s.testLidarrConnection(client)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -128,3 +132,21 @@ func (s *service) testSonarrConnection(client domain.DownloadClient) error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *service) testLidarrConnection(client domain.DownloadClient) error {
|
||||
r := lidarr.New(lidarr.Config{
|
||||
Hostname: client.Host,
|
||||
APIKey: client.Settings.APIKey,
|
||||
BasicAuth: client.Settings.Basic.Auth,
|
||||
Username: client.Settings.Basic.Username,
|
||||
Password: client.Settings.Basic.Password,
|
||||
})
|
||||
|
||||
_, err := r.Test()
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msgf("lidarr: connection test failed: %v", client.Host)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue