fix(releases): retry action missing external indexer identifier (#1612)

* fix(releases): retry action missing external identifier

* fix(actions): arrs set fallback indexer identifier
This commit is contained in:
ze0s 2024-08-11 20:39:11 +02:00 committed by GitHub
parent 3183e15a4b
commit abfac05b66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 105 additions and 18 deletions

View file

@ -22,6 +22,7 @@ type IndexerRepo interface {
Delete(ctx context.Context, id int) error
FindByFilterID(ctx context.Context, id int) ([]Indexer, error)
FindByID(ctx context.Context, id int) (*Indexer, error)
GetBy(ctx context.Context, req GetIndexerRequest) (*Indexer, error)
ToggleEnabled(ctx context.Context, indexerID int, enabled bool) error
}
@ -43,6 +44,14 @@ type IndexerMinimal struct {
IdentifierExternal string `json:"identifier_external"`
}
func (m IndexerMinimal) GetExternalIdentifier() string {
if m.IdentifierExternal != "" {
return m.IdentifierExternal
}
return m.Identifier
}
type IndexerDefinition struct {
ID int `json:"id,omitempty"`
Name string `json:"name"`
@ -412,3 +421,9 @@ type IndexerTestApiRequest struct {
ApiUser string `json:"api_user,omitempty"`
ApiKey string `json:"api_key"`
}
type GetIndexerRequest struct {
ID int
Identifier string
Name string
}