mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 03:26:37 +08:00
8824638efb
Backend
- service/transcoder.go: encoder selector (software / nvenc / qsv /
vaapi) with proper hwaccel + scale_* filters per encoder; configurable
bitrate/preset/height/segment-seconds via transcoder.* config; new
Active() snapshot + ActiveJob struct for the Tasks panel; unit-tested
via buildFFmpegArgs(...).
- service/thetvdb.go: TheTVDB v4 provider — login() caches the JWT for
24h, SearchSeries() returns Match struct.
- service/fanart.go: Fanart.tv provider — high-res movie artwork keyed
by TMDb id; used to upgrade poster/backdrop after a successful match.
- service/scraper.go: provider chain reworked — anime → Bangumi, tv →
TheTVDB, default → TMDb, with optional Fanart upgrade post-match.
- service/discover.go: TMDb /trending/movie/day + /movie/popular for
the Discover rail.
- service/ai.go: OpenAI-compatible client. SmartSearch() turns a free-
form query into a structured SearchIntent JSON; Recommend() emits a
short list of titles given the user's history. Disabled when
ai.api_key is empty.
- service/nfo.go: per-movie .nfo writer (Kodi/Jellyfin schema) +
library-scope batch exporter.
- service/media.go: SoftDelete / Restore / Purge / ListRecycleBin
helpers backed by gorm Unscoped().
- service/service.go: container wires Fanart, TheTVDB, Discover, AI,
NFO; everything still tears down cleanly via Close().
- config: new transcoder.* section (encoder, preset, video_bitrate,
max_rate, buf_size, max_height, segment_seconds) with sensible
defaults.
Handlers / routes
- new files: discover.go, recycle.go, nfo.go, ai.go, tasks.go.
- registers GET /tasks, /discover/{trending,popular},
/ai/{status,search,recommend}; admin-only GET /recycle and
DELETE/POST /media/:id (soft delete / restore / purge); admin-only
POST /media/:id/nfo and /libraries/:id/nfo.
Frontend
- new pages: DiscoverPage, TasksPage, RecycleBinPage; SearchPage gains
an optional AI smart-search toggle that calls /api/ai/search.
- MediaDetailPage gains admin actions for 导出 NFO and 移至回收站.
- new api/ helpers: ai.ts, discover.ts, recycle.ts, tasks.ts.
- App.tsx routes /discover, /tasks, /recycle (last two admin-only).
- Layout sidebar groups now include Discover + Tasks + Recycle Bin.
Docker / config
- Dockerfile: adds intel-media-driver / libva-utils / mesa-va-gallium
so QSV + VAAPI work out of the box on Intel iGPUs.
- docker-compose.yml: documents devices + group_add + nvidia runtime
overrides for hardware transcoding.
Verified: go build, go vet, go test (incl. new TestBuildFFmpegArgs across
software / nvenc / qsv / vaapi encoder profiles); tsc -b && vite build
emits 22 route chunks plus the deferred hls chunk; main bundle 248 KB /
83 KB gzipped.
65 lines
2.1 KiB
YAML
65 lines
2.1 KiB
YAML
version: '3.8'
|
|
|
|
# ============================================================================
|
|
# MediaStationGo — recommended NAS deployment.
|
|
#
|
|
# 1. Edit the volume mappings under `volumes:` so that /media points at your
|
|
# actual library root (e.g. /volume1/Media).
|
|
# 2. (Optional) set MEDIASTATION_SECRETS_JWT_SECRET to a strong random string;
|
|
# otherwise one is auto-generated and persisted to /data/.jwt_secret.
|
|
# 3. `docker compose up -d` and visit http://<host>:8080 (admin / admin123).
|
|
# ============================================================================
|
|
|
|
services:
|
|
mediastation-go:
|
|
build:
|
|
context: .
|
|
image: ghcr.io/shukebta/mediastation-go:latest
|
|
container_name: mediastation-go
|
|
restart: unless-stopped
|
|
|
|
ports:
|
|
- "8080:8080"
|
|
|
|
volumes:
|
|
- ./data:/data
|
|
- ./cache:/cache
|
|
# Mount your media library into /media. Read-only is fine.
|
|
# - /volume1/Media:/media:ro
|
|
|
|
environment:
|
|
MEDIASTATION_APP_PORT: 8080
|
|
MEDIASTATION_APP_DATA_DIR: /data
|
|
MEDIASTATION_APP_WEB_DIR: /app/web/dist
|
|
MEDIASTATION_DATABASE_DB_PATH: /data/mediastation.db
|
|
MEDIASTATION_CACHE_CACHE_DIR: /cache
|
|
MEDIASTATION_LOGGING_LEVEL: info
|
|
# MEDIASTATION_TRANSCODER_ENCODER: vaapi # qsv | vaapi | nvenc | (empty=software)
|
|
# MEDIASTATION_TRANSCODER_MAX_HEIGHT: 1080
|
|
# MEDIASTATION_SECRETS_JWT_SECRET: change-me-to-a-strong-random-string
|
|
# MEDIASTATION_APP_CORS_ORIGINS: '["https://media.example.com"]'
|
|
PUID: "1000"
|
|
PGID: "1000"
|
|
TZ: Asia/Shanghai
|
|
|
|
# Hardware-accelerated transcoding.
|
|
# * Intel iGPU (QSV / VAAPI): mount /dev/dri.
|
|
# * NVIDIA NVENC: switch the runtime to nvidia and add `gpus: all`.
|
|
# devices:
|
|
# - /dev/dri:/dev/dri
|
|
# group_add:
|
|
# - "989" # match render GID on host
|
|
# runtime: nvidia
|
|
# deploy:
|
|
# resources:
|
|
# reservations:
|
|
# devices:
|
|
# - capabilities: [gpu]
|
|
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8080/api/health || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 30s
|