mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Plugin hooks (#1452)
* Refactor session and plugin code * Add context to job tasks * Show hooks in plugins page * Refactor session management
This commit is contained in:
@@ -3,7 +3,6 @@ package plugin
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/stashapp/stash/pkg/models"
|
||||
"github.com/stashapp/stash/pkg/plugin/common"
|
||||
)
|
||||
|
||||
@@ -31,11 +30,10 @@ type taskBuilder interface {
|
||||
}
|
||||
|
||||
type pluginTask struct {
|
||||
plugin *Config
|
||||
operation *OperationConfig
|
||||
serverConnection common.StashServerConnection
|
||||
args []*models.PluginArgInput
|
||||
gqlHandler http.HandlerFunc
|
||||
plugin *Config
|
||||
operation *OperationConfig
|
||||
input common.PluginInput
|
||||
gqlHandler http.Handler
|
||||
|
||||
progress chan float64
|
||||
result *common.PluginOutput
|
||||
@@ -48,12 +46,3 @@ func (t *pluginTask) GetResult() *common.PluginOutput {
|
||||
func (t *pluginTask) createTask() Task {
|
||||
return t.plugin.Interface.getTaskBuilder().build(*t)
|
||||
}
|
||||
|
||||
func (t *pluginTask) buildPluginInput() common.PluginInput {
|
||||
args := applyDefaultArgs(t.args, t.operation.DefaultArgs)
|
||||
t.serverConnection.PluginDir = t.plugin.getConfigPath()
|
||||
return common.PluginInput{
|
||||
ServerConnection: t.serverConnection,
|
||||
Args: toPluginArgs(args),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user