add studiomode force-transition command

patch bump
This commit is contained in:
onyx-and-iris 2025-06-10 19:10:07 +01:00
parent 560b88e949
commit 020f376010
2 changed files with 24 additions and 1 deletions

View File

@ -1,6 +1,6 @@
[project] [project]
name = "slobs-cli" name = "slobs-cli"
version = "0.7.1" version = "0.7.2"
description = "A command line application for Streamlabs Desktop" description = "A command line application for Streamlabs Desktop"
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }] authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
dependencies = ["pyslobs>=2.0.4", "asyncclick>=8.1.8"] dependencies = ["pyslobs>=2.0.4", "asyncclick>=8.1.8"]

View File

@ -98,3 +98,26 @@ async def toggle(ctx: click.Context):
async with create_task_group() as tg: async with create_task_group() as tg:
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) 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)