No description
  • Go 98.5%
  • Makefile 1.2%
  • Dockerfile 0.3%
Find a file
zemdregon a7be46060f
Some checks are pending
CI / lint (push) Waiting to run
CI / test (push) Waiting to run
CI / build (push) Waiting to run
CI / docker (push) Blocked by required conditions
feat: title matching and grabfix helper (vault-tested)
2026-08-17 09:35:01 -05:00
.github build(deps): bump actions/setup-go from 6 to 7 (#31) 2026-08-12 09:47:57 -05:00
cmd feat: title matching and grabfix helper (vault-tested) 2026-08-17 09:35:01 -05:00
deploy feat: download-event delay/settings and indexer fanout tests 2026-07-22 19:09:34 -05:00
internal feat: title matching and grabfix helper (vault-tested) 2026-08-17 09:35:01 -05:00
proto/automationv1 Regenerate gRPC stubs for absolute episode fields. 2026-08-09 21:19:43 -05:00
test Initial commit: media-automation module 2026-06-15 20:08:05 -05:00
.dockerignore Initial commit: media-automation module 2026-06-15 20:08:05 -05:00
.env.example Initial commit: media-automation module 2026-06-15 20:08:05 -05:00
.gitignore Initial commit: media-automation module 2026-06-15 20:08:05 -05:00
.golangci.yml Initial commit: media-automation module 2026-06-15 20:08:05 -05:00
CHANGELOG.md test: offline Dispatch→ImportPath, pagination load, cut v0.1.8 2026-08-10 10:35:00 -05:00
COMPATIBILITY.md feat: download-event delay/settings and indexer fanout tests 2026-07-22 19:09:34 -05:00
CONTRIBUTING.md feat: download-event delay/settings and indexer fanout tests 2026-07-22 19:09:34 -05:00
Dockerfile Initial commit: media-automation module 2026-06-15 20:08:05 -05:00
go.mod chore(deps): bump google.golang.org/grpc to v1.83.0 (#29) 2026-08-10 19:12:20 -05:00
go.sum chore(deps): bump google.golang.org/grpc to v1.83.0 (#29) 2026-08-10 19:12:20 -05:00
LICENSE Initial commit: media-automation module 2026-06-15 20:08:05 -05:00
Makefile Initial commit: media-automation module 2026-06-15 20:08:05 -05:00
muxcore.json test: offline Dispatch→ImportPath, pagination load, cut v0.1.8 2026-08-10 10:35:00 -05:00
README.md feat: per-series delay and release-group overrides (#19) 2026-08-09 19:52:25 -05:00
ROADMAP.md feat: download-event delay/settings and indexer fanout tests 2026-07-22 19:09:34 -05:00
SECURITY.md feat: download-event delay/settings and indexer fanout tests 2026-07-22 19:09:34 -05:00

Media Automation

CI Go Version License: GPL-3.0

Automation engine for MuxCore — searches indexers, scores releases, and dispatches downloads for wanted media.

A MuxCore sidecar module that bridges the gap between library management and downloading. It monitors wanted items, searches indexer modules, scores results by quality, and sends the best match to a downloader.


How It Works

Admin UI ──→ media-automation ──→ indexer modules (parallel Search)
                │                      ├── site module A
                │                      ├── site module B
                │                      └── aggregator (optional)
                ├──→ downloader (dispatch)
                │
                └──→ SQLite (queue + history)

Key Features

  • Quality scoring — prefers media-custom-formats ScoreRelease when available; falls back to local ranking by resolution (2160p > 1080p > 720p), format (Remux > BluRay > WEB-DL > HDTV), seeders, and size sanity
  • Upgrade / cutoff / delay — after import, keeps wanted items below profile cutoff when upgrades are allowed; re-searches and grabs only strictly better scores after upgrade_delay_minutes
  • Protocol delay profiles — waits before grab using seeded delay_profiles (default: torrent 15m, usenet 0)
  • Per-series overrides — optional delay_minutes plus preferred/ignored release groups (series_overrides_json setting or AUTOMATION_SERIES_OVERRIDES_JSON)
  • Multi-indexer search — discovers all modules advertising capability indexer, searches them in parallel, merges results, dedupes by GUID (or download URL), then scores and limits
  • Download dispatch — sends selected releases to a downloader module
  • Wanted items queue — persistence via SQLite with monitoring and missing state
  • Periodic RSS sync — automatically searches for wanted items on an interval (default 15 minutes; mesh setting rss_sync_minutes)
  • Mesh settings — capability settings: enable_automatic_search, enable_automatic_upgrades, rss_sync_minutes
  • Download history — tracks all dispatched downloads with status
  • Import on complete — on download.completed, asks media-scanner to ImportPath the torrent save path and marks history complete (or import_failed); download.failed marks history failed. On media.*.file_added, marks the wanted item owned (or removes it at cutoff / when upgrades disabled).

Configuration

Ops note: scanner watch directory

For import-on-complete to work, register the downloaders DOWNLOAD_DIR (or whatever path torrents finish in) as a media-scanner watch directory. ImportPath only accepts paths under a registered watch dir; otherwise the history row is marked import_failed.

CLI Flags

Flag Default Description
--muxcore-mesh-addr - Core gRPC address
--muxcore-module-id media-automation Module identity

Environment Variables

Variable Default Description
AUTOMATION_DB_PATH /var/lib/media-automation/automation.db SQLite database path
AUTOMATION_GRPC_ADDR :9460 gRPC listen address
MUXCORE_GRPC_ADDR localhost:9090 Core mesh gRPC address
MUXCORE_MODULE_ID media-automation Module identity (overrides --muxcore-module-id)
MUXCORE_INSECURE_DISABLE_TLS false Disable TLS for dev
AUTOMATION_SERIES_OVERRIDES_JSON [] Seed/replace per-series overrides on init (JSON array)

Quick Start

# Build
make build

# Run against local core (dev mode)
export MUXCORE_INSECURE_DISABLE_TLS=true
./media-automation --muxcore-mesh-addr localhost:9090

gRPC API

SearchItem

Score-based search across all discovered indexer modules (parallel fan-out, merge, dedupe).

{
  "item_type": "movie",
  "query": "Fight Club",
  "year": 1999,
  "limit": 50
}

Dispatch

Send a selected release to the downloader.

{
  "guid": "abc123",
  "title": "Fight Club 1999 1080p BluRay",
  "download_url": "magnet:?...",
  "download_protocol": "http"
}

AddToQueue / GetQueue / GetHistory

Queue management and history.


Development

make test     # run tests with race detection
make lint     # golangci-lint
make fmt      # format code
make proto    # regenerate protobuf code

License

GPL-3.0