mkv2cast.watcher
Watch mode for mkv2cast.
Monitors directories for new MKV files and automatically converts them. Uses watchdog library if available, falls back to polling otherwise.
Functions
|
Watch a directory for new MKV files and convert them. |
Classes
|
Watch a directory for new MKV files. |
|
Handler for new MKV files. |
|
Watchdog event handler for MKV files. |
- class mkv2cast.watcher.MKVFileHandler(convert_callback: Callable[[Path], None], cfg: Config, stable_wait: int = 5)[source]
Bases:
objectHandler for new MKV files.
- class mkv2cast.watcher.WatchdogHandler(mkv_handler: MKVFileHandler)[source]
Bases:
FileSystemEventHandlerWatchdog event handler for MKV files.
- class mkv2cast.watcher.DirectoryWatcher(watch_path: Path, convert_callback: Callable[[Path], None], cfg: Config, interval: float = 5.0, recursive: bool = True)[source]
Bases:
objectWatch a directory for new MKV files.
Uses watchdog if available, otherwise falls back to polling.
- mkv2cast.watcher.watch_directory(path: Path, convert_callback: Callable[[Path], None], cfg: Config, interval: float = 5.0, print_fn: Callable[[str], None] | None = None) None[source]
Watch a directory for new MKV files and convert them.
This function blocks until interrupted (Ctrl+C).
- Parameters:
path – Directory to watch.
convert_callback – Function to call for each new MKV file.
cfg – Configuration instance.
interval – Polling interval in seconds.
print_fn – Optional function to print status messages.