3.6 KiB
Executable File
title, created, updated, type, namespace, tags, related
| title | created | updated | type | namespace | tags | related | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Media Pipeline Pitfalls | 2026-05-23 | 2026-05-27 | tech | family |
|
|
Media Pipeline Pitfalls
Torrents — Do Not Rename Files
Never rename torrent source files or folders while a torrent is active. Transmission tracks files by path. Renaming breaks the association and causes re-download or stalled seeding.
Правильный порядок (когда файл уже лежит в нужном месте, но с другим кейсом):
- Переименовать файл/папку на диске (Linux ext4 case-sensitive)
- Вызвать
torrent-set-locationс новым путём +move=false - Запустить торрент на сидирование
torrent-set-location Updates downloadDir
torrent-set-location in the Transmission RPC updates downloadDir in
the torrent metadata. Use this when moving completed files, not a manual
rename. Sequence:
- Move files to new location on disk
- Call
torrent-set-locationwith the new path +move=false - Verify torrent goes back to seeding state
Router Creates Subdirectories — Transmission downloadDir Stale
router.py creates subdirectory per title under the genre folder
(lowercase name, e.g. /media/cartoons/бобик в гостях у барбоса/).
Transmission still holds the old downloadDir pointing to the parent
(/media/cartoons/). Result: torrents show "No data found" error.
Fix:
- Find the actual subdirectory on disk
- Call
torrent-set-locationwith the subdirectory path +move=false - Transmission verifies and resumes seeding
Alpine Container — No Docker-in-Docker
on-download-complete.sh runs inside the Transmission Alpine container.
Docker CLI is not available there — using docker run inside the container
fails silently or errors. Python 3.14 IS available in the Alpine image.
Solution: sync.py (Python3, ~190 lines) in the same container:
- Reads
config.jsonfor sorting rules + credentials (same file as linker container) - Queries TMDB for genre routing
- Creates hardlinks + calls Transmission RPC
torrent-set-locationLocation:/srv/.../docker/media-pipeline/sync.py
Transmission download-dir — без /complete
download-dir: /downloads (не /downloads/complete).
incomplete-dir: /downloads/incomplete (enabled).
Менять через остановку Transmission → правка settings.json → запуск.
media-router.sh — Telegram-уведомления
Скрипт-обёртка над router.py. Запускается из crontab каждые 10 минут.
- При
Nothing to do— SILENT - При активности — отправляет отчёт в Telegram Kraken (kraken_htpc_bot)
BOT_TOKENиCHAT_IDхардкодом в скрипте
Удаление дубликатов из downloads/complete
После перемещения файлов в /media/{movies,cartoons,series,...}/:
- Проверить, что файлы в movies — реальные (-rwx), не symlink'и
- Проверить что inode разные (это копии, не один файл)
- Удалить из
downloads/complete/ - Обновить путь в Transmission
General Rules
- Never touch source files/folders (media-pipeline USER.md rule)
resolve-manualis emergency-only- NFO files: do not create manually; let the pipeline handle them
- Never delete test files from the pipeline project