feat(filters): add music filters (#91)

* feat(filters): add music filters

* feat: improve parsing and filtering

* feat: add red api support
This commit is contained in:
Ludvig Lundgren 2022-01-19 18:50:04 +01:00 committed by GitHub
parent 30c11d4ef1
commit 00bc8298ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 1053 additions and 52 deletions

View file

@ -9,6 +9,7 @@ import (
"github.com/autobrr/autobrr/pkg/btn"
"github.com/autobrr/autobrr/pkg/ggn"
"github.com/autobrr/autobrr/pkg/ptp"
"github.com/autobrr/autobrr/pkg/red"
)
type APIService interface {
@ -104,6 +105,13 @@ func (s *apiService) AddClient(indexer string, settings map[string]string) error
}
s.apiClients[indexer] = ggn.NewClient("", key)
case "redacted":
key, ok := settings["api_key"]
if !ok || key == "" {
return fmt.Errorf("api_service: could not initialize red client: missing var 'api_key'")
}
s.apiClients[indexer] = red.NewClient("", key)
default:
return fmt.Errorf("api_service: could not initialize client: unsupported indexer '%v'", indexer)