Skip to content

Commit

Permalink
Adding in File Post Hooks
Browse files Browse the repository at this point in the history
This seems too simple but I think this is it?

fixes stashapp#3001
  • Loading branch information
Gykes committed Aug 30, 2024
1 parent 96fdd94 commit 0e22663
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/plugin/examples/js/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions pkg/plugin/hook/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -87,6 +91,10 @@ var AllHookTriggerEnum = []TriggerEnum{
TagUpdatePost,
TagMergePost,
TagDestroyPost,

FileDestroyPost,
FileUpdatePost,
FileCreatePost,
}

func (e TriggerEnum) IsValid() bool {
Expand Down Expand Up @@ -124,6 +132,10 @@ func (e TriggerEnum) IsValid() bool {
StudioUpdatePost,
StudioDestroyPost,

FileDestroyPost,
FileUpdatePost,
FileCreatePost,

TagCreatePost,
TagUpdatePost,
TagDestroyPost:
Expand Down

0 comments on commit 0e22663

Please sign in to comment.