From 020f3760100593b910511e505cda9e3d36255aeb Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Tue, 10 Jun 2025 19:10:07 +0100 Subject: [PATCH] add studiomode force-transition command patch bump --- pyproject.toml | 2 +- src/slobs_cli/studiomode.py | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 74dd42e..bf7d335 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "slobs-cli" -version = "0.7.1" +version = "0.7.2" description = "A command line application for Streamlabs Desktop" authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }] dependencies = ["pyslobs>=2.0.4", "asyncclick>=8.1.8"] diff --git a/src/slobs_cli/studiomode.py b/src/slobs_cli/studiomode.py index a038eb0..1ca6799 100644 --- a/src/slobs_cli/studiomode.py +++ b/src/slobs_cli/studiomode.py @@ -98,3 +98,26 @@ async def toggle(ctx: click.Context): async with create_task_group() as tg: tg.start_soon(conn.background_processing) tg.start_soon(_run) + + +@studiomode.command() +@click.pass_context +async def force_transition(ctx: click.Context): + """Force a transition in studio mode.""" + + conn = ctx.obj["connection"] + ts = TransitionsService(conn) + + async def _run(): + current_state = await ts.get_model() + if not current_state.studio_mode: + conn.close() + raise click.Abort(click.style("Studio mode is not enabled.", fg="red")) + + await ts.execute_studio_mode_transition() + click.echo("Forced studio mode transition.") + conn.close() + + async with create_task_group() as tg: + tg.start_soon(conn.background_processing) + tg.start_soon(_run)