Include path and hashes in destroy hook input (#2102)

This commit is contained in:
WithoutPants
2021-12-13 14:38:00 +11:00
committed by GitHub
parent 9a8f05d826
commit 79e01589ca
6 changed files with 91 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
package plugin
import (
"github.com/stashapp/stash/pkg/models"
"github.com/stashapp/stash/pkg/plugin/common"
)
@@ -125,3 +126,36 @@ func (e HookTriggerEnum) String() string {
func addHookContext(argsMap common.ArgsMap, hookContext common.HookContext) {
argsMap[common.HookContextKey] = hookContext
}
// types for destroy hooks, to provide a little more information
type SceneDestroyInput struct {
models.SceneDestroyInput
Checksum string `json:"checksum"`
OSHash string `json:"oshash"`
Path string `json:"path"`
}
type ScenesDestroyInput struct {
models.ScenesDestroyInput
Checksum string `json:"checksum"`
OSHash string `json:"oshash"`
Path string `json:"path"`
}
type GalleryDestroyInput struct {
models.GalleryDestroyInput
Checksum string `json:"checksum"`
Path string `json:"path"`
}
type ImageDestroyInput struct {
models.ImageDestroyInput
Checksum string `json:"checksum"`
Path string `json:"path"`
}
type ImagesDestroyInput struct {
models.ImagesDestroyInput
Checksum string `json:"checksum"`
Path string `json:"path"`
}