bin/hooks/README.md
standalone programs which are executed by copyparty when an event happens (upload, file rename, delete, ...)
these programs either take zero arguments, or a filepath (the affected file), or a json message with filepath + additional info
run copyparty with --help-hooks for usage details / hook type explanations (xm/xbu/xau/xiu/xbc/xac/xbr/xar/xbd/xad/xban)
in particular, if a hook is loaded into copyparty with the hook-flag c ("check") then its exit-code controls the action that launched the hook:
0 = allow the action, and/or continue running the next hook100 = allow the action, and stop running any remaining consecutive hooksnote: in addition to event hooks (the stuff described here), copyparty has another api to run your programs/scripts while providing way more information such as audio tags / video codecs / etc and optionally daisychaining data between scripts in a processing pipeline; if that's what you want then see mtp plugins instead
idx hook effect to tell copyparty about additional files to scan/indexthese are --xiu hooks; unlike xbu and xau (which get executed on every single file), xiu hooks are given a list of recent uploads on STDIN after the server has gone idle for N seconds, reducing server load + providing more context
reloc hook effectI flag which makes it 140x faster, but if the plugin has a bug it may crash copypartyI flag makes the hook 140x faster (but you need to be Very Careful when writing the plugin)