From 0e2266327a429305fe40d75ff6646d8b6949c064 Mon Sep 17 00:00:00 2001 From: Gykes Date: Thu, 29 Aug 2024 18:17:34 -0700 Subject: [PATCH] Adding in File Post Hooks This seems too simple but I think this is it? fixes https://github.com/stashapp/stash/issues/3001 --- pkg/plugin/examples/js/js.yml | 3 +++ pkg/plugin/hook/hooks.go | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/pkg/plugin/examples/js/js.yml b/pkg/plugin/examples/js/js.yml index 25f0d56e345..4a1d96d291a 100644 --- a/pkg/plugin/examples/js/js.yml +++ b/pkg/plugin/examples/js/js.yml @@ -52,6 +52,9 @@ hooks: - Tag.Create.Post - Tag.Update.Post - Tag.Destroy.Post + - File.Destroy.Post + - File.Update.Post + - File.Create.Post defaultArgs: mode: hook diff --git a/pkg/plugin/hook/hooks.go b/pkg/plugin/hook/hooks.go index a8235b1834d..428e99cf57f 100644 --- a/pkg/plugin/hook/hooks.go +++ b/pkg/plugin/hook/hooks.go @@ -48,6 +48,10 @@ const ( TagUpdatePost TriggerEnum = "Tag.Update.Post" TagMergePost TriggerEnum = "Tag.Merge.Post" TagDestroyPost TriggerEnum = "Tag.Destroy.Post" + + FileDestroyPost TriggerEnum = "File.Destroy.Post" + FileUpdatePost TriggerEnum = "File.Update.Post" + FileCreatePost TriggerEnum = "File.Create.Post" ) var AllHookTriggerEnum = []TriggerEnum{ @@ -87,6 +91,10 @@ var AllHookTriggerEnum = []TriggerEnum{ TagUpdatePost, TagMergePost, TagDestroyPost, + + FileDestroyPost, + FileUpdatePost, + FileCreatePost, } func (e TriggerEnum) IsValid() bool { @@ -124,6 +132,10 @@ func (e TriggerEnum) IsValid() bool { StudioUpdatePost, StudioDestroyPost, + FileDestroyPost, + FileUpdatePost, + FileCreatePost, + TagCreatePost, TagUpdatePost, TagDestroyPost: