feat: fix download-to-user matching, add cover art to downloads
- Fix seriesMap key (use Sonarr internal id, not tvdbId) - Fix Sonarr tag resolution (use tag map like Radarr) - Use sourceTitle for history record matching - Fall back to embedded movie/series objects when API timeouts - Add includeMovie/includeSeries params to queue/history API calls - Add coverArt field to all download responses (TMDB poster URLs) - Add cover art display to frontend download cards - Fix user-summary route to use instance config and tag maps
This commit is contained in:
309
README.md
309
README.md
@@ -1,136 +1,219 @@
|
||||
# Media Download Dashboard
|
||||
# sofarr
|
||||
|
||||
A dashboard for tracking SABnzbd downloads matched to Sonarr/Radarr activity by user, with user identification via Emby server sessions.
|
||||
> *See your downloads "so far" while you relax on the sofa waiting for your *arr services to finish*
|
||||
|
||||
## Features
|
||||
**sofarr** is a personal media download dashboard that aggregates and displays real-time download progress from all your media automation services. Named for the experience of checking what has downloaded "so far" while you wait comfortably on your "sofa" for Sonarr, Radarr, and your download clients to do their thing!
|
||||
|
||||
- **User Identification**: Automatically identifies the current user from active Emby server sessions
|
||||
- **Download Tracking**: Retrieves download details from SABnzbd
|
||||
- **Service Integration**: Matches downloads to activity in Sonarr and Radarr
|
||||
- **User Tag Matching**: Identifies requesting users from tags present against shows or movies
|
||||
- **Personalized Dashboard**: Presents details of downloading shows/movies for the current user
|
||||
## What It Does
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Node.js (v14 or higher)
|
||||
- npm
|
||||
- SABnzbd instance
|
||||
- Sonarr instance
|
||||
- Radarr instance
|
||||
- Emby instance
|
||||
|
||||
## Installation
|
||||
|
||||
1. Clone the repository and navigate to the project directory
|
||||
|
||||
2. Install dependencies:
|
||||
```bash
|
||||
npm install
|
||||
cd client && npm install
|
||||
cd ..
|
||||
```
|
||||
|
||||
3. Copy the example environment file and configure your services:
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Edit `.env` with your service URLs and API keys:
|
||||
```
|
||||
PORT=3001
|
||||
SABNZBD_URL=http://localhost:8080
|
||||
SABNZBD_API_KEY=your_sabnzbd_api_key
|
||||
SONARR_URL=http://localhost:8989
|
||||
SONARR_API_KEY=your_sonarr_api_key
|
||||
RADARR_URL=http://localhost:7878
|
||||
RADARR_API_KEY=your_radarr_api_key
|
||||
EMBY_URL=http://localhost:8096
|
||||
EMBY_API_KEY=your_emby_api_key
|
||||
```
|
||||
|
||||
## Tagging Your Media
|
||||
|
||||
To enable user-specific download tracking, tag your shows and movies in Sonarr/Radarr:
|
||||
|
||||
1. In Sonarr/Radarr, go to your series/movie settings
|
||||
2. Add a tag with the format: `user:username` (e.g., `user:john`)
|
||||
3. Apply this tag to the series/movies you want to track for that user
|
||||
|
||||
The dashboard will match downloads to users based on these tags.
|
||||
|
||||
## Usage
|
||||
|
||||
Start the development servers:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
This will start:
|
||||
- Backend server on `http://localhost:3001`
|
||||
- Frontend development server on `http://localhost:5173`
|
||||
|
||||
Open your browser and navigate to `http://localhost:5173`
|
||||
sofarr connects to your media stack and shows you a personalized view of:
|
||||
- **Active Downloads** - See what's currently downloading from Usenet (SABnzbd) and BitTorrent (qBittorrent)
|
||||
- **Progress Tracking** - Real-time progress bars with speed, ETA, and completion estimates
|
||||
- **User Matching** - Downloads are matched to you based on tags in Sonarr/Radarr
|
||||
- **Multi-Instance Support** - Connect to multiple instances of each service
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Session Detection**: The dashboard connects to Emby to detect active user sessions
|
||||
2. **User Identification**: The current user is identified from their active Emby session
|
||||
3. **Download Retrieval**: SABnzbd queue and history are retrieved
|
||||
4. **Activity Matching**: Downloads are matched to Sonarr/Radarr queue and history
|
||||
5. **Tag Matching**: The user tag from the series/movie is extracted and matched to the current user
|
||||
6. **Display**: Only downloads matching the current user are displayed
|
||||
### Architecture Overview
|
||||
|
||||
```
|
||||
┌─────────────┐ ┌──────────────┐ ┌─────────────────────────────┐
|
||||
│ Browser │────▶│ sofarr │────▶│ SABnzbd (Usenet downloads) │
|
||||
│ (User) │◀────│ Server │ │ qBittorrent (Torrents) │
|
||||
└─────────────┘ └──────────────┘ │ Sonarr (TV management) │
|
||||
│ │ Radarr (Movie management) │
|
||||
│ │ Emby (User authentication) │
|
||||
▼ └─────────────────────────────┘
|
||||
┌──────────────┐
|
||||
│ Dashboard │
|
||||
│ Aggregator │
|
||||
└──────────────┘
|
||||
```
|
||||
|
||||
### The Matching Process
|
||||
|
||||
1. **User Authentication**: Login via Emby credentials
|
||||
2. **Tag-Based Matching**:
|
||||
- Your media in Sonarr/Radarr is tagged with your username (e.g., "gordon")
|
||||
- sofarr checks Sonarr/Radarr activity to find items tagged with your name
|
||||
- Downloads (from SABnzbd/qBittorrent) are matched by title to that activity
|
||||
- Only your downloads appear on your dashboard
|
||||
|
||||
### Multi-Instance Support
|
||||
|
||||
sofarr supports multiple instances of each service via JSON array configuration:
|
||||
|
||||
```bash
|
||||
# Single line JSON arrays in .env
|
||||
QBITTORRENT_INSTANCES=[{"name":"server1","url":"..."},{"name":"server2","url":"..."}]
|
||||
SONARR_INSTANCES=[{"name":"main","url":"...","apiKey":"..."}]
|
||||
```
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Node.js (v12 or higher)
|
||||
- npm
|
||||
- At least one of: SABnzbd or qBittorrent
|
||||
- Sonarr (optional, for TV tracking)
|
||||
- Radarr (optional, for movie tracking)
|
||||
- Emby (for user authentication)
|
||||
|
||||
## Installation
|
||||
|
||||
1. **Clone and install**:
|
||||
```bash
|
||||
git clone <repository-url>
|
||||
cd sofarr
|
||||
npm install
|
||||
```
|
||||
|
||||
2. **Configure environment**:
|
||||
```bash
|
||||
cp .env.sample .env
|
||||
# Edit .env with your service details
|
||||
```
|
||||
|
||||
3. **Start the server**:
|
||||
```bash
|
||||
npm start
|
||||
# or for development with auto-restart:
|
||||
npm run dev
|
||||
```
|
||||
|
||||
4. **Access the dashboard**:
|
||||
Open `http://localhost:3001` in your browser
|
||||
|
||||
## Configuration (.env)
|
||||
|
||||
### Basic Server Settings
|
||||
```bash
|
||||
PORT=3001 # Server port
|
||||
LOG_LEVEL=info # Logging: debug, info, warn, error, silent
|
||||
```
|
||||
|
||||
### Service Instances (JSON Array Format)
|
||||
|
||||
All services support multi-instance configuration via single-line JSON arrays:
|
||||
|
||||
```bash
|
||||
# SABnzbd Instances
|
||||
SABNZBD_INSTANCES=[{"name":"primary","url":"https://sabnzbd.example.com","apiKey":"your-api-key"}]
|
||||
|
||||
# qBittorrent Instances (uses username/password, not API key)
|
||||
QBITTORRENT_INSTANCES=[{"name":"main","url":"https://qbittorrent.example.com","username":"admin","password":"secret"}]
|
||||
|
||||
# Sonarr Instances
|
||||
SONARR_INSTANCES=[{"name":"hd","url":"https://sonarr.example.com","apiKey":"your-api-key"}]
|
||||
|
||||
# Radarr Instances
|
||||
RADARR_INSTANCES=[{"name":"movies","url":"https://radarr.example.com","apiKey":"your-api-key"}]
|
||||
|
||||
# Emby (single instance for authentication)
|
||||
EMBY_URL=https://emby.example.com
|
||||
EMBY_API_KEY=your-emby-api-key
|
||||
```
|
||||
|
||||
### Legacy Single-Instance Format (still supported)
|
||||
|
||||
If you only have one instance, you can use the legacy format:
|
||||
```bash
|
||||
SABNZBD_URL=https://sabnzbd.example.com
|
||||
SABNZBD_API_KEY=your-api-key
|
||||
```
|
||||
|
||||
## Setting Up User Tags
|
||||
|
||||
To see your downloads, you need to tag your media in Sonarr/Radarr:
|
||||
|
||||
1. **In Sonarr** (TV Shows):
|
||||
- Go to Series → Edit Series
|
||||
- Add a tag with your username (lowercase)
|
||||
- Save
|
||||
|
||||
2. **In Radarr** (Movies):
|
||||
- Go to Movies → Edit Movie
|
||||
- Add a tag with your username (lowercase)
|
||||
- Save
|
||||
|
||||
3. **Result**: When sofarr sees a download matching a show/movie tagged with "gordon", it appears on gordon's dashboard
|
||||
|
||||
## Features in Detail
|
||||
|
||||
### Real-Time Updates
|
||||
- Auto-refresh every 5 seconds (configurable: 1s, 5s, 10s, or off)
|
||||
- In-place DOM updates for smooth UI (no flickering)
|
||||
|
||||
### Download Information Displayed
|
||||
- **Progress bar** with visual completion percentage
|
||||
- **Speed** - Current download speed
|
||||
- **ETA** - Estimated time remaining
|
||||
- **Size** - Total size and downloaded amount
|
||||
- **Status** - Downloading, Paused, Queued, etc.
|
||||
- **Instance** - Which server the download is from
|
||||
|
||||
### For qBittorrent Downloads
|
||||
- **Seeds** - Number of seeders
|
||||
- **Peers** - Number of peers
|
||||
- **Availability** - Percentage available in swarm
|
||||
|
||||
## API Endpoints
|
||||
|
||||
### SABnzbd
|
||||
- `GET /api/sabnzbd/queue` - Get current queue
|
||||
- `GET /api/sabnzbd/history` - Get download history
|
||||
|
||||
### Sonarr
|
||||
- `GET /api/sonarr/queue` - Get Sonarr queue
|
||||
- `GET /api/sonarr/history` - Get Sonarr history
|
||||
- `GET /api/sonarr/series` - Get all series with tags
|
||||
- `GET /api/sonarr/series/:id` - Get specific series details
|
||||
|
||||
### Radarr
|
||||
- `GET /api/radarr/queue` - Get Radarr queue
|
||||
- `GET /api/radarr/history` - Get Radarr history
|
||||
- `GET /api/radarr/movies` - Get all movies with tags
|
||||
- `GET /api/radarr/movies/:id` - Get specific movie details
|
||||
|
||||
### Emby
|
||||
- `GET /api/emby/sessions` - Get active sessions
|
||||
- `GET /api/emby/users` - Get all users
|
||||
- `GET /api/emby/users/:id` - Get specific user details
|
||||
- `GET /api/emby/session/:sessionId/user` - Get user from session
|
||||
### Authentication
|
||||
- `POST /api/auth/login` - Login with Emby credentials
|
||||
- `POST /api/auth/logout` - Logout and clear session
|
||||
|
||||
### Dashboard
|
||||
- `GET /api/dashboard/user-downloads/:sessionId` - Get downloads for current user
|
||||
- `GET /api/dashboard/user-summary` - Get download summary for all users
|
||||
- `GET /api/dashboard/downloads` - Get all downloads for authenticated user
|
||||
|
||||
## Production Build
|
||||
### Service APIs (proxy to your services)
|
||||
- `GET /api/sabnzbd/*` - SABnzbd API proxy
|
||||
- `GET /api/qbittorrent/*` - qBittorrent API proxy
|
||||
- `GET /api/sonarr/*` - Sonarr API proxy
|
||||
- `GET /api/radarr/*` - Radarr API proxy
|
||||
- `GET /api/emby/*` - Emby API proxy
|
||||
|
||||
Build the frontend for production:
|
||||
## Logging Levels
|
||||
|
||||
```bash
|
||||
npm run client:build
|
||||
```
|
||||
Set `LOG_LEVEL` in your `.env`:
|
||||
- `debug` - Verbose logging for troubleshooting
|
||||
- `info` - Standard operational logging (default)
|
||||
- `warn` - Only warnings and errors
|
||||
- `error` - Only errors
|
||||
- `silent` - No logging
|
||||
|
||||
Start the production server:
|
||||
|
||||
```bash
|
||||
npm run server:start
|
||||
```
|
||||
|
||||
The frontend will be served from the backend server.
|
||||
Logs are written to both console and `server.log` file.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- **"Failed to fetch Emby sessions"**: Ensure Emby is running and the API key is correct
|
||||
- **"No downloads found"**: Ensure your media is tagged with `user:username` format
|
||||
- **Download not showing**: Check that the download name matches between SABnzbd and Sonarr/Radarr
|
||||
**"No downloads showing"**
|
||||
- Verify your media is tagged with your username in Sonarr/Radarr
|
||||
- Check that LOG_LEVEL=debug shows matching attempts
|
||||
- Ensure download names match between client and *arr apps
|
||||
|
||||
**"Can't connect to service"**
|
||||
- Check URLs are accessible from the sofarr server
|
||||
- Verify API keys and credentials
|
||||
- Check CORS settings on your services
|
||||
|
||||
**"qBittorrent not showing"**
|
||||
- Ensure username/password are correct
|
||||
- Check qBittorrent Web UI is enabled
|
||||
- Verify the URL includes the full path (e.g., `https://qb.example.com`)
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
# Start with auto-restart on changes
|
||||
npm run dev
|
||||
|
||||
# Production start
|
||||
npm start
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
---
|
||||
|
||||
*sofarr: See what has downloaded "so far" from the comfort of your "sofa"*
|
||||
|
||||
Reference in New Issue
Block a user