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:
@@ -11,6 +11,8 @@ function main() {
|
||||
doLongTask();
|
||||
} else if (modeArg == "indef") {
|
||||
doIndefiniteTask();
|
||||
} else if (modeArg == "hook") {
|
||||
doHookTask();
|
||||
}
|
||||
} catch (err) {
|
||||
return {
|
||||
@@ -207,4 +209,9 @@ function doIndefiniteTask() {
|
||||
}
|
||||
}
|
||||
|
||||
function doHookTask() {
|
||||
log.Info("JS Hook called!");
|
||||
log.Info(input.Args);
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -24,4 +24,35 @@ tasks:
|
||||
description: Sleeps for 100 seconds - interruptable
|
||||
defaultArgs:
|
||||
mode: long
|
||||
|
||||
hooks:
|
||||
- name: Log scene marker create/update
|
||||
description: Logs some stuff when creating/updating scene marker.
|
||||
triggeredBy:
|
||||
- SceneMarker.Create.Post
|
||||
- SceneMarker.Update.Post
|
||||
- SceneMarker.Delete.Post
|
||||
- Scene.Create.Post
|
||||
- Scene.Update.Post
|
||||
- Scene.Destroy.Post
|
||||
- Image.Create.Post
|
||||
- Image.Update.Post
|
||||
- Image.Destroy.Post
|
||||
- Gallery.Create.Post
|
||||
- Gallery.Update.Post
|
||||
- Gallery.Destroy.Post
|
||||
- Movie.Create.Post
|
||||
- Movie.Update.Post
|
||||
- Movie.Destroy.Post
|
||||
- Performer.Create.Post
|
||||
- Performer.Update.Post
|
||||
- Performer.Destroy.Post
|
||||
- Studio.Create.Post
|
||||
- Studio.Update.Post
|
||||
- Studio.Destroy.Post
|
||||
- Tag.Create.Post
|
||||
- Tag.Update.Post
|
||||
- Tag.Destroy.Post
|
||||
defaultArgs:
|
||||
mode: hook
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user