9001 / 9001/copyparty

allow triggering indexing from xau hook based on absolute path

Open
#1,515 2 comments 0 reactions 1 assignee Claimed by @9001 View on GitHub
enhancement
Dominant language
Python
Stars
46.6k
Forks
1.9k
Avg merge
10d 16h
Merged PRs (30d)
5

Description

**is your feature request related to a problem? Please describe.**
currently, `xau` hooks that create new files can trigger indexing by printing (e.g.) `json.dumps({"idx":{"vp":["/foo/1.txt","/foo/bar/2.txt"]}})`
in this syntax, absolute paths are relative to the root of the volume, relative paths are relative to the file that triggered the hook. however, sometimes it is more convenient to use the absolute path (for example, because the hook just passed it to an external tool that needed the absolute path anyway)

**Describe the idea / solution you'd like**
support the following syntax: `"idx": {"ap": ["/home/me/copyparty/cool-files/new-file.txt"]}`, which then should cause copyparty to index that file the same as if it were triggered via a volume path
this should probably also support `reloc` and maybe `del` (making sure that this doesn't cause copyparty to delete files outside any volume), but I don't have a specific use for these

**Describe any alternatives you've considered**
i just let the normal indexer deal with it

**Additional Context**
I think this behaviour is handled here: https://github.com/9001/copyparty/blob/27031f73be12071625c93ab231eb0235b74b2c04/copyparty/up2k.py#L5646-L5650

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.