Automatic folder watcher for media files.
The watch module scans configured folders (local paths or remote locations via rclone) for new movie and TV episode files, attempts to identify them using release parsers and TMDb, and imports matching items into the system as streams (movies) or streams_series/streams_episodes (TV). It can also update existing streams (upgrade source), add items to bouquets, enqueue auto-encoding, and download artwork.
- Periodic scanning via CLI cron command
cron:watch. - Per-file processing performed by the
watch_itemcommand. - TMDb matching and metadata import (posters, backdrop, cast, genres, runtime, trailers).
- Support for local directories and
rcloneremote folders. - Automatic addition to bouquets and categories based on genres and module settings.
- Options: auto-upgrade, auto-encode (queue), extract metadata via ffprobe, subtitle handling.
- CLI:
php console.php cron:watch— run scheduled scan. Optional folder ID:php console.php cron:watch <folder_id>to force a single folder. - CLI:
php console.php watch_item "<base64(json)>"— process a single payload (used by cron to dispatch jobs). - HTTP API actions:
enable_watch,disable_watch,kill_watch,folder(delete/force) exposed by the module router.
- Requires a valid TMDb API key in settings (
tmdb_api_key). - Important settings available via
SettingsManager:percentage_match— minimal similarity for TMDb matchparse_type—guessitorptnrelease parserdownload_images— whether to download poster/backdrop imagesauto_encode— queue imported items for encodingthread_count,scan_seconds,max_items,max_genres,alternative_titles,fallback_parser
- Uses
WATCH_TMP_PATHfor caches and coordination files:movie_<tmdb>.cache,series_<tmdb>.cache,*.bouquet,*.wpid,lock_<id>.
- Processing results and errors are recorded in the
watch_logstable.
- The module integrates with other services:
StreamProcess,ImageUtils, andTMDBclient libraries. - Be cautious when enabling
auto_upgradeandauto_encode; they may modify existing streams or enqueue heavy encoding jobs.
For details, inspect the module source files in this folder: WatchCron.php, WatchCronJob.php, WatchItem.php, WatchItemCommand.php, WatchService.php, and WatchController.php.