feat(generation): resume manual summary jobs
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/tradarr/backend/internal/ai"
|
||||
"github.com/tradarr/backend/internal/auth"
|
||||
@ -15,16 +16,18 @@ import (
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
companyCatalog CompanyCatalog
|
||||
indexSearcher indices.IndexSearcher
|
||||
generationUseCase generation.UseCase
|
||||
repo *models.Repository
|
||||
cfg *config.Config
|
||||
enc *crypto.Encryptor
|
||||
registry *scraper.Registry
|
||||
pipeline *ai.Pipeline
|
||||
scheduler *scheduler.Scheduler
|
||||
reportManager *ai.ReportManager
|
||||
companyCatalog CompanyCatalog
|
||||
indexSearcher indices.IndexSearcher
|
||||
generationJobs interface {
|
||||
Start(context.Context, string) (models.GenerationJob, error)
|
||||
}
|
||||
repo *models.Repository
|
||||
cfg *config.Config
|
||||
enc *crypto.Encryptor
|
||||
registry *scraper.Registry
|
||||
pipeline *ai.Pipeline
|
||||
scheduler *scheduler.Scheduler
|
||||
reportManager *ai.ReportManager
|
||||
}
|
||||
|
||||
func New(
|
||||
@ -51,6 +54,13 @@ func New(
|
||||
}
|
||||
}
|
||||
|
||||
func (h *Handler) SetGenerationUseCase(uc generation.UseCase) { h.generationUseCase = uc }
|
||||
func (h *Handler) SetGenerationUseCase(uc generation.UseCase) {
|
||||
if h.repo != nil && uc != nil {
|
||||
h.generationJobs = generation.NewJobs(h.repo, uc)
|
||||
}
|
||||
}
|
||||
func (h *Handler) SetGenerationJobs(jobs interface {
|
||||
Start(context.Context, string) (models.GenerationJob, error)
|
||||
}) { h.generationJobs = jobs }
|
||||
|
||||
func (h *Handler) AdminOnly() gin.HandlerFunc { return auth.AdminOnly(h.repo) }
|
||||
|
||||
Reference in New Issue
Block a user