feat(indexers): update PTP announce to new format (#1738)

* feat(indexers): update PTP to new format

* fix: update expect line

* feat: use unique key for dl link

* feat: update pattern

* fix: definition tests

* feat: rename var

* feat: add custom vars map

* feat: start mapCustomVars

* Update internal/indexer/definitions/ptp.yaml

Co-authored-by: nuxen <felix.schubert1998@gmail.com>

* feat(indexers): map custom indexer vars

* feat: support upload unix epoch time

* feat(releases): update mapvars

* feat(indexers): remove ptp api init

* feat(indexers): update ptp category mapping

* feat(releases): show announce type in details

* feat(releases): mapvars announcetype

---------

Co-authored-by: nuxen <felix.schubert1998@gmail.com>
This commit is contained in:
ze0s 2024-12-08 23:35:32 +01:00 committed by GitHub
parent f644b3a4d6
commit 24f31574e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 342 additions and 108 deletions

View file

@ -13,7 +13,6 @@ import (
"github.com/autobrr/autobrr/pkg/errors"
"github.com/autobrr/autobrr/pkg/ggn"
"github.com/autobrr/autobrr/pkg/ops"
"github.com/autobrr/autobrr/pkg/ptp"
"github.com/autobrr/autobrr/pkg/red"
"github.com/rs/zerolog"
@ -94,18 +93,6 @@ func (s *apiService) AddClient(indexer string, settings map[string]string) error
}
s.apiClients[indexer] = btn.NewClient(key)
case "ptp":
user, ok := settings["api_user"]
if !ok || user == "" {
return errors.New("api.Service.AddClient: could not initialize ptp client: missing var 'api_user'")
}
key, ok := settings["api_key"]
if !ok || key == "" {
return errors.New("api.Service.AddClient: could not initialize ptp client: missing var 'api_key'")
}
s.apiClients[indexer] = ptp.NewClient(user, key)
case "ggn":
key, ok := settings["api_key"]
if !ok || key == "" {
@ -156,16 +143,6 @@ func (s *apiService) getClientForTest(req domain.IndexerTestApiRequest) (apiClie
}
return btn.NewClient(req.ApiKey), nil
case "ptp":
if req.ApiUser == "" {
return nil, errors.New("api.Service.AddClient: could not initialize ptp client: missing var 'api_user'")
}
if req.ApiKey == "" {
return nil, errors.New("api.Service.AddClient: could not initialize ptp client: missing var 'api_key'")
}
return ptp.NewClient(req.ApiUser, req.ApiKey), nil
case "ggn":
if req.ApiKey == "" {
return nil, errors.New("api.Service.AddClient: could not initialize ggn client: missing var 'api_key'")