
TinyMediaManager Advanced: Batch Organization, Automated Workflows, and Docker Unattended Operation
The first two articles covered what TMM is and how to install it. This one goes further — how to make TMM truly shine.
If you already have hundreds or thousands of movies, scraping them one by one manually is impractical. The real way to use it is to set up an automated pipeline: file import → auto-detection → auto-scraping → auto-organization → media server auto-refresh.
TMM provides three weapons for this pipeline: Command Line, HTTP API, and Docker Automation.
1. Command Line Mode
Most people use TMM by opening the GUI and clicking around. But TMM also supports full command-line operation — which is critical for server environments and headless NAS setups.
Basic Usage
# View all available parameters
./tinyMediaManager --help
Core commands:
# Update all media sources (scan for new files)
./tinyMediaManager --updateSources
# Scrape all unscraped movies
./tinyMediaManager --scrapeUnscraped
# Scrape and rename
./tinyMediaManager --scrapeUnscraped --rename
# Rename only
./tinyMediaManager --rename
# Generate NFO
./tinyMediaManager --export
Scheduled Auto-Scraping with cron
Drop TMM into crontab to automatically scrape newly added movies every night:
# Auto-scrape every day at 3 AM
0 3 * * * /opt/tinymediamanager/tinyMediaManager --scrapeUnscraped --rename >> /var/log/tmm.log 2>&1
Same logic works with the Docker version:
0 3 * * * docker exec tmm tinyMediaManager --scrapeUnscraped --rename >> /var/log/tmm.log 2>&1
Note: Command-line mode does not start the GUI by default, so it can safely run on headless servers.
2. HTTP API
Starting with TMM v5, an HTTP API is available for triggering operations remotely via HTTP requests.
Enabling the API
Go to Settings → General → HTTP API:
- Check “Enable HTTP API”
- Set the API port (default 8080)
- Set an API Key (for authentication)
Common API Calls
# API Key
API_KEY="your-api-key"
TMM_HOST="localhost:8080"
# Update all media sources
curl -X POST "http://${TMM_HOST}/api/tmm/updatesources?api_key=${API_KEY}"
# Scrape unscraped movies
curl -X POST "http://${TMM_HOST}/api/tmm/scrapeunscraped?api_key=${API_KEY}"
# Query status
curl "http://${TMM_HOST}/api/tmm/status?api_key=${API_KEY}"
# Query media library statistics
curl "http://${TMM_HOST}/api/tmm/statistics?api_key=${API_KEY}"
Integration with Download Tools
This is the most satisfying use case — automatically triggering TMM to scrape after a download completes.
Using qBittorrent as an example, in the webhook or external script after download completes:
#!/bin/bash
# /opt/scripts/torrent-done.sh
# Called after qBittorrent download completes
# Wait for file writes to finish
sleep 30
# Notify TMM to update sources and scrape
curl -s -X POST "http://localhost:8080/api/tmm/updatesources?api_key=${API_KEY}"
curl -s -X POST "http://localhost:8080/api/tmm/scrapeunscraped?api_key=${API_KEY}"
# Notify Emby to refresh the media library
curl -s -X POST "http://localhost:8096/emby/Library/Refresh?api_key=${EMBY_API_KEY}"
The combined effect of this chain: movie download complete → TMM auto-scrapes → Emby auto-refreshes → watchable on TV immediately.
Zero human intervention required.
3. Docker Unattended Solution
If your TMM runs in Docker, combined with cron or systemd timer, you can achieve full automation.
Complete Docker Automation Deployment
version: "2.1"
services:
tmm:
image: tinymediamanager/tinymediamanager:latest
container_name: tmm
environment:
- USER_ID=1000
- GROUP_ID=1000
- ALLOW_DIRECT_VNC=true
- LC_ALL=zh_CN.UTF-8
- LANG=zh_CN.UTF-8
- PASSWORD=your_vnc_password
- TZ=Asia/Shanghai
volumes:
- ./tmm_data:/data # TMM config and data
- /mnt/media/movies:/media/movies
- /mnt/media/tvshows:/media/tv_shows
- ./scripts:/scripts # Mount automation scripts
ports:
- 5900:5900
- 4000:4000
restart: unless-stopped
Scheduled Task Script
In the host’s crontab:
# Scrape new movies every day at 2 AM
0 2 * * * docker exec tmm /scripts/scrape.sh
Contents of scrape.sh:
#!/bin/bash
# TMM command line running inside Docker container
export DISPLAY=:0
/opt/tinyMediaManager/tinyMediaManager --scrapeUnscraped --rename
# Notify Emby to refresh after scraping
curl -s -X POST "http://emby:8096/emby/Library/Refresh?api_key=${EMBY_API_KEY}"
4. Batch Organization Tips
Naming Conventions
TMM’s naming template feature is very powerful. In Settings → Movies → Renaming, you can customize file and directory naming rules.
My personal recommended configuration:
Directory naming: {title} ({year})
File naming: {title} ({year}) - [{vf}]
Example output:
/media/movies/Inception (2010)/
Inception (2010) - [1080p].mkv
/media/movies/Interstellar (2014)/
Interstellar (2014) - [2160p].mkv
This naming style is clean and has the best media server compatibility.
Collection Categorization
Select one or more movies → Right-click → Add to Collection. You can create a new collection (e.g., “Marvel Cinematic Universe”) or add to an existing one.
TMM will automatically pull collection posters and descriptions from TMDB, which will display as collections in Emby/Jellyfin.
Batch Poster Replacement
If you’re not satisfied with certain movie posters:
- Select multiple movies
- Click “Search and Scrape”
- In the Artwork tab, choose your preferred poster version
- Apply to all selected movies
Filtering and Searching
TMM supports advanced filtering:
- Filter by scraped/unscraped
- Filter by resolution (1080p / 4K)
- Filter by rating, year, genre
- Filter by tags
These filters are very useful for batch operations — like “select all unscraped 4K movies and process them all at once.”
5. Common Advanced Questions
How to migrate to a new server?
All of TMM’s configuration and data is in ~/.tinyMediaManager/ (Linux) or the TMM data directory.
To migrate, just copy this directory and your media files, then unzip TMM on the new machine and you’re good to go.
Managing media libraries on multiple servers simultaneously?
TMM supports multiple media sources. You can:
- Add both
/mnt/disk1/moviesand/mnt/disk2/moviesas sources - TMM will merge them for unified scraping
- After NFO generation, each media server scans its own directory
Does TMM conflict with Sonarr/Radarr?
No. TMM manages metadata, Sonarr/Radarr manage downloads.
A recommended combination:
- Radarr/Sonarr: Automatically download movies/TV shows
- TMM: Scrape metadata and organize downloaded files
- Emby/Jellyfin: Read NFO and display
Each does its own job without interference.
Summary
The core idea behind TMM’s advanced usage is one concept: let the machine do the work for you.
- Command line + cron → scheduled unattended scraping
- HTTP API + download tool webhook → auto-scrape after download
- Docker + scheduled scripts → stable server operation
Once the entire pipeline is running, maintaining your media library becomes “just drop files in, TMM handles the rest.”
The ultimate home theater experience isn’t about how good your equipment is — it’s about turning on the TV and watching, without having to think about anything.
Comments