mkv2cast.ui.rich_ui

Rich-based progress UI for mkv2cast.

Provides beautiful multi-worker progress display with colors and animations. Requires the ‘rich’ package to be installed.

Respects: - NO_COLOR environment variable - MKV2CAST_SCRIPT_MODE environment variable - sys.stdout.isatty() for automatic detection

Classes

JobStatus(inp[, stage, pct, speed, dur_ms, ...])

Tracks the status of a single file.

RichProgressUI(total_files, encode_workers, ...)

Rich-based progress UI showing all files with their status.

class mkv2cast.ui.rich_ui.JobStatus(inp: Path, stage: str = 'WAITING', pct: int = 0, speed: str = '', dur_ms: int = 0, out_ms: int = 0, start_time: float = 0, integrity_start: float = 0, integrity_elapsed: float = 0, encode_start: float = 0, encode_elapsed: float = 0, total_elapsed: float = 0, result_msg: str = '', output_file: str = '', worker_id: int = -1, history_id: int = 0)[source]

Bases: object

Tracks the status of a single file.

inp: Path
stage: str = 'WAITING'
pct: int = 0
speed: str = ''
dur_ms: int = 0
out_ms: int = 0
start_time: float = 0
integrity_start: float = 0
integrity_elapsed: float = 0
encode_start: float = 0
encode_elapsed: float = 0
total_elapsed: float = 0
result_msg: str = ''
output_file: str = ''
worker_id: int = -1
history_id: int = 0
class mkv2cast.ui.rich_ui.RichProgressUI(total_files: int, encode_workers: int, integrity_workers: int)[source]

Bases: object

Rich-based progress UI showing all files with their status.

jobs: Dict[str, JobStatus]
completed_log: List[str]
live: Live | None
start()[source]

Start the live display.

stop()[source]

Stop the live display.

register_job(inp: Path, backend: str = '')[source]

Register a new job in waiting state.

start_integrity(worker_id: int, _filename: str, inp: Path)[source]

Start integrity check for a file.

update_integrity(worker_id: int, _stage: str, pct: int, _filename: str, speed: str = '', inp: Path | None = None)[source]

Update integrity progress.

stop_integrity(worker_id: int, inp: Path | None = None)[source]

Mark integrity check as complete.

start_encode(worker_id: int, _filename: str, inp: Path, output_file: str = '')[source]

Start encoding for a file.

update_encode(worker_id: int, _stage: str, pct: int, _filename: str, speed: str = '', inp: Path | None = None, out_ms: int = 0, dur_ms: int = 0)[source]

Update encode progress.

stop_encode(worker_id: int, inp: Path | None = None)[source]

Mark encode as complete.

mark_done(inp: Path, _msg: str = '', final_path: Path | None = None, output_size: int = 0)[source]

Mark a job as successfully completed.

mark_failed(inp: Path, reason: str = '')[source]

Mark a job as failed.

mark_skipped(inp: Path, reason: str = '')[source]

Mark a job as skipped.

log(msg: str)[source]

Add a message to the log.

get_stats() Tuple[int, int, int, int][source]

Get current statistics.