feat(media): chaptarr hardlinks + keeps its own ebook copy

Chaptarr had /downloads, /ebooks and /audiobooks as separate bind mounts, so
hardlinks failed with EXDEV and every import was a full copy (each seeding
audiobook stored twice). Mount /storage1 once and symlink the old container
paths into it via an entrypoint wrapper, so nothing in chaptarr's DB changes.

/ebooks now points at /storage1/Media/Ebooks, chaptarr's own ebook folder.
A Custom Script hook hardlinks each new ebook into the CWA ingest folder, so
CWA deleting its ingest copy no longer makes chaptarr think the book is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ginnoir (outpost agent)andClaude Opus 5.5 committed 2026-12-03 03:57:34 -06:00
1 parent 417cd3165f
commit 5d70a4e825
4 files changed
+73 -8

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
# Chaptarr entrypoint wrapper (compose: entrypoint: /scripts/start.sh).
#
# /storage1 is mounted ONCE; /downloads, /audiobooks and /ebooks are symlinks into it.
# Separate bind mounts make link() fail with EXDEV, and chaptarr silently falls back to a
# full copy, so every seeding audiobook used to exist twice on disk. One mount → real hardlinks.
# The container paths stay the same, so nothing in chaptarr's DB had to change.
set -e
link() { # $1 = container path, $2 = target under /storage1
if [ -L "$1" ]; then
ln -sfn "$2" "$1"
elif [ -d "$1" ]; then
rmdir "$1" # fails loudly if something unexpected is in there
ln -s "$2" "$1"
else
ln -s "$2" "$1"
fi
}
link /downloads /storage1/complete
link /audiobooks /storage1/Media/Audiobooks
link /ebooks /storage1/Media/Ebooks
exec /entrypoint.sh "$@"