# qBittorrent & SMB AI Video Performer Sorter An automated, AI-powered media organizer with in-browser video streaming, multi-performer candidate selection, directory-backed Intellisense, and SQLite persistent caching for **qBittorrent** and **SMB/TrueNAS** video shares. --- ## Features - **Dual-Tab Media Sorter**: - **qBittorrent Library Sorter**: Analyzes torrent titles & internal files and moves torrent content seamlessly without breaking active seeding. - **SMB / Network Share Sorter**: Directly scans video shares with dedicated sub-tabs for `/videodownloader` (`/mnt/isolation/videos/videodownloader`) and `/unsorted` (`/mnt/isolation/videos/unsorted`), parses performer names, and relocates them into categorized folders (`/mnt/isolation/videos//`). - **Multi-AI Provider Support**: - **Google Gemini** (Gemini 2.5/3.0+ models) - **Anthropic Claude** (Claude 3.5 Sonnet, Haiku, Opus) - **OpenAI** (GPT-4o, GPT-4o-mini) - **Local / Network LLM Fallback** (LM Studio / Ollama on `odysseus.local` or localhost with auto-failover on rate limits) - **Multi-Performer Candidate Selection**: - Automatically identifies scenes with multiple co-stars (e.g. `Kendra Lust and Lisa Ann` or `Alison Rey Reagan Foxx`). - Renders distinct clickable candidate pills so you can easily choose which performer folder receives the file. - **In-Browser Video Streaming & Preview**: - Built-in HTTP 206 Partial Content video streaming server. - Watch videos directly inside the browser with fast seeking, speed controls (0.75x–2.0x), and skip buttons (-30s, +30s). - Pick performer candidates and approve moves directly from inside the preview player modal with playlist navigation (`◀ Prev` / `Next ▶`). - **Directory-Backed Performer Intellisense**: - Real-time autocomplete dropdown drawn from your existing video library (hundreds of performer folders) as you type. - **SQLite Persistent Caching**: - Saves all AI analysis results, candidate lists, and move statuses to `performer_sorter.db`. - Never wastes API tokens re-analyzing previously scanned files. --- ## Quick Start ### 1. Requirements - Python 3.8+ (Standard library only — zero external Python package dependencies required!) - CIFS/SMB share mounted or access to qBittorrent WebUI. ### 2. Start the Server **Foreground:** ```bash python3 server.py ``` **Background (Silent Mode):** ```bash ./start.sh # Start in background (logs to server.log) ./stop.sh # Stop running server ./restart.sh # Restart server ``` ### 3. Open in Browser Visit **`http://localhost:8000`** (or your machine's IP on port 8000). --- ## Configuration Expand the **Configuration & Engine Settings** bar at the top of the web UI to configure: - **qBittorrent WebUI**: Host URL, Username, Password, and Target Root (`/isolation/videos`). - **SMB Share Settings**: Source path (`/mnt/isolation/videos/videodownloader`) and Target root (`/mnt/isolation/videos`). - **AI Settings**: API Provider, API Key, Model name, and optional Local LLM endpoint (`http://odysseus.local:1234/v1`). - **Naming Format**: `firstname.lastname`, `performername`, or `Firstname.Lastname`.