feat: hwaccel + Fanart/TheTVDB + AI + Discover + NFO + Tasks + Recycle bin

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.
This commit is contained in:
Kiro
2026-05-14 16:22:08 +00:00
parent 7bd6bcfb1b
commit 8824638efb
32 changed files with 1795 additions and 83 deletions
+16 -6
View File
@@ -42,7 +42,10 @@ making deployment painless on NAS hardware.
- ✅ Library CRUD + recursive filesystem scan
- ✅ ffprobe metadata extraction (duration / resolution / codecs / container)
- ✅ Scene-noise filename cleaner with year + season/episode parsing
- ✅ TMDb scraper (movies) + Bangumi scraper (anime), provider chain by library type
- ✅ Multi-provider scrape chain by library type:
- movie → TMDb (with optional Fanart.tv high-res poster upgrade)
- tv → TheTVDB (fallback TMDb)
- anime → Bangumi (fallback TMDb)
- ✅ Image proxy with disk cache for TMDb / Bangumi / Douban / Fanart / TheTVDB
- ✅ TV / anime libraries grouped by season with episode listing
- ✅ fsnotify-based filesystem watcher with 5 s coalescing debouncer
@@ -61,8 +64,17 @@ making deployment painless on NAS hardware.
### Operations
- ✅ Real-time scan / scrape / transcode / download / subscription events over WebSocket
- ✅ Operator dashboard at `/stats` (CPU / memory / disk / library counts / Goroutines)
- ✅ Real-time tasks panel at `/tasks` (active ffmpeg jobs + qBittorrent torrents)
- ✅ Recycle bin at `/recycle` (soft delete + restore + purge)
- ✅ NFO export (Kodi / Jellyfin compatibility) — single media or whole library
- ✅ Hardware-accel encoder profiles: software / NVENC / Intel QSV / VAAPI
- ✅ Single-binary build, multi-arch Docker image, GitHub Actions CI + GHCR publish
### Discovery & AI
- ✅ TMDb Discover — Trending (today) + Popular rails on `/discover`
- ✅ AI smart search (OpenAI-compatible) — natural-language queries → structured intent
- ✅ AI recommendations seeded from your watch history (`GET /api/ai/recommend`)
### Frontend
- ✅ React SPA with code-splitting: Login / Home / Library / Search / Favourites /
Playlists / Media detail / Player (HLS + direct + subtitles) / Profile /
@@ -74,12 +86,10 @@ making deployment painless on NAS hardware.
| Area | Status |
|------|--------|
| Hardware-accelerated transcoding (NVENC / QSV / VAAPI) profiles | ⏳ |
| Douban / Fanart / TheTVDB providers | ⏳ |
| Subtitle search (online providers) | ⏳ |
| Emby/Jellyfin compatibility layer | ⏳ |
| Bidirectional Jellyfin / Emby compatibility layer | ⏳ |
| DLNA / Chromecast | ⏳ |
| AI metadata enhancement & smart search | ⏳ |
| Online subtitle search providers | ⏳ |
| Multi-bitrate ABR transcode profiles | ⏳ |
---