9001 / 9001/copyparty

feature request: hook effects in xiu hooks

Open
#1,571 0 comments 1 reaction 1 assignee Claimed by @9001 View on GitHub
enhancement
Dominant language
Python
Stars
46.7k
Forks
1.9k
Avg merge
9d 2h
Merged PRs (30d)
4

Description

**is your feature request related to a problem? Please describe.**
I'm making a hook that [reencodes FLAC to Opus on upload](https://github.com/minipps/copyparty-hooks/blob/main/lossless_to_opus.py). For this I chose xiu since I want to do this after full file uploads and I want to be able to delete the old FLAC and re-index the new OGG after upload, however, it seems like xiu uses `runihook` instead of `runhook` which doesn't support hook effects

**Describe the idea / solution you'd like**
Add [hook effects](https://github.com/9001/copyparty/blob/fface524c3463918677bd01a6aff7d09dbbbc29d/docs/devnotes.md#hook-effects) to xiu too :)

**Describe any alternatives you've considered**
for now I'm just using a lower scan period for indexing and os.unlink() to delete the file manually from inside my hook, although this is obviously way worse.

Contributor guide

Open the contributing guide

Research direction

Look at the xiu module to understand how it currently uses runihook. Compare with the regular runhook implementation that supports hook effects. The devnotes.md link explains hook effects. The change likely involves modifying xiu to call runhook with effects support, then testing with a sample hook that uses effects like file deletion or re-indexing.

Written by the indexing model from the issue text.

Assessment

Domain
backend, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.