feat(lists): integrate Omegabrr (#1885)

* feat(lists): integrate Omegabrr

* feat(lists): add missing lists index

* feat(lists): add db repo

* feat(lists): add db migrations

* feat(lists): labels

* feat(lists): url lists and more arrs

* fix(lists): db migrations client_id wrong type

* fix(lists): db fields

* feat(lists): create list form wip

* feat(lists): show in list and create

* feat(lists): update and delete

* feat(lists): trigger via webhook

* feat(lists): add webhook handler

* fix(arr): encode json to pointer

* feat(lists): rename endpoint to lists

* feat(lists): fetch tags from arr

* feat(lists): process plaintext lists

* feat(lists): add background refresh job

* run every 6th hour with a random start delay between 1-35 seconds

* feat(lists): refresh on save and improve logging

* feat(lists): cast arr client to pointer

* feat(lists): improve error handling

* feat(lists): reset shows field with match release

* feat(lists): filter opts all lists

* feat(lists): trigger on update if enabled

* feat(lists): update option for lists

* feat(lists): show connected filters in list

* feat(lists): missing listSvc dep

* feat(lists): cleanup

* feat(lists): typo arr list

* feat(lists): radarr include original

* feat(lists): rename ExcludeAlternateTitle to IncludeAlternateTitle

* fix(lists): arr client type conversion to pointer

* fix(actions): only log panic recover if err not nil

* feat(lists): show spinner on save

* feat(lists): show icon in filters list

* feat(lists): change icon color in filters list

* feat(lists): delete relations on filter delete
This commit is contained in:
ze0s 2024-12-25 13:23:37 +01:00 committed by GitHub
parent b68ae334ca
commit 221bc35371
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 5025 additions and 254 deletions

View file

@ -8,8 +8,8 @@ import (
"time"
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/pkg/arr/lidarr"
"github.com/autobrr/autobrr/pkg/errors"
"github.com/autobrr/autobrr/pkg/lidarr"
)
func (s *service) lidarr(ctx context.Context, action *domain.Action, release domain.Release) ([]string, error) {
@ -27,7 +27,7 @@ func (s *service) lidarr(ctx context.Context, action *domain.Action, release dom
return nil, errors.New("client %s %s not enabled", client.Type, client.Name)
}
arr := client.Client.(lidarr.Client)
arr := client.Client.(*lidarr.Client)
r := lidarr.Release{
Title: release.TorrentName,

View file

@ -8,8 +8,8 @@ import (
"time"
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/pkg/arr/radarr"
"github.com/autobrr/autobrr/pkg/errors"
"github.com/autobrr/autobrr/pkg/radarr"
)
func (s *service) radarr(ctx context.Context, action *domain.Action, release domain.Release) ([]string, error) {
@ -27,7 +27,7 @@ func (s *service) radarr(ctx context.Context, action *domain.Action, release dom
return nil, errors.New("client %s %s not enabled", client.Type, client.Name)
}
arr := client.Client.(radarr.Client)
arr := client.Client.(*radarr.Client)
r := radarr.Release{
Title: release.TorrentName,

View file

@ -8,8 +8,8 @@ import (
"time"
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/pkg/arr/readarr"
"github.com/autobrr/autobrr/pkg/errors"
"github.com/autobrr/autobrr/pkg/readarr"
)
func (s *service) readarr(ctx context.Context, action *domain.Action, release domain.Release) ([]string, error) {
@ -27,7 +27,7 @@ func (s *service) readarr(ctx context.Context, action *domain.Action, release do
return nil, errors.New("client %s %s not enabled", client.Type, client.Name)
}
arr := client.Client.(readarr.Client)
arr := client.Client.(*readarr.Client)
r := readarr.Release{
Title: release.TorrentName,

View file

@ -18,17 +18,11 @@ import (
"github.com/autobrr/autobrr/pkg/errors"
)
func (s *service) RunAction(ctx context.Context, action *domain.Action, release *domain.Release) ([]string, error) {
var (
err error
rejections []string
)
func (s *service) RunAction(ctx context.Context, action *domain.Action, release *domain.Release) (rejections []string, err error) {
defer func() {
if r := recover(); r != nil {
s.log.Error().Msgf("recovering from panic in run action %s error: %v", action.Name, r)
err = errors.New("panic in action: %s", action.Name)
return
errors.RecoverPanic(recover(), &err)
if err != nil {
s.log.Error().Err(err).Msgf("recovering from panic in run action %s", action.Name)
}
}()

View file

@ -30,7 +30,7 @@ type Service interface {
DeleteByFilterID(ctx context.Context, filterID int) error
ToggleEnabled(actionID int) error
RunAction(ctx context.Context, action *domain.Action, release *domain.Release) ([]string, error)
RunAction(ctx context.Context, action *domain.Action, release *domain.Release) (rejections []string, err error)
}
type service struct {

View file

@ -8,8 +8,8 @@ import (
"time"
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/pkg/arr/sonarr"
"github.com/autobrr/autobrr/pkg/errors"
"github.com/autobrr/autobrr/pkg/sonarr"
)
func (s *service) sonarr(ctx context.Context, action *domain.Action, release domain.Release) ([]string, error) {
@ -27,7 +27,7 @@ func (s *service) sonarr(ctx context.Context, action *domain.Action, release dom
return nil, errors.New("client %s %s not enabled", client.Type, client.Name)
}
arr := client.Client.(sonarr.Client)
arr := client.Client.(*sonarr.Client)
r := sonarr.Release{
Title: release.TorrentName,