Feature: Save releases (#36)

* chore: tidy deps

* refactor: database migration

* refactor: store release

* refactor: save release

* chore: add packages

* feat(web): show stats and recent releases

* refactor: simply filter struct

* feat: add eventbus

* chore: cleanup logging

* chore: update packages
This commit is contained in:
Ludvig Lundgren 2021-11-24 23:18:12 +01:00 committed by GitHub
parent d22dd2fe84
commit 7177e48c02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 5859 additions and 3328 deletions

View file

@ -1,6 +1,7 @@
package action
import (
"github.com/asaskevich/EventBus"
"github.com/autobrr/autobrr/internal/domain"
"github.com/autobrr/autobrr/internal/download_client"
)
@ -11,16 +12,17 @@ type Service interface {
Delete(actionID int) error
ToggleEnabled(actionID int) error
RunActions(actions []domain.Action, announce domain.Announce) error
RunActions(actions []domain.Action, release domain.Release) error
}
type service struct {
repo domain.ActionRepo
clientSvc download_client.Service
bus EventBus.Bus
}
func NewService(repo domain.ActionRepo, clientSvc download_client.Service) Service {
return &service{repo: repo, clientSvc: clientSvc}
func NewService(repo domain.ActionRepo, clientSvc download_client.Service, bus EventBus.Bus) Service {
return &service{repo: repo, clientSvc: clientSvc, bus: bus}
}
func (s *service) Store(action domain.Action) (*domain.Action, error) {