Add toggle for automatic MusicGPT polling in settings

This commit is contained in:
Troll (Hermes Agent) 2026-08-10 23:35:55 +00:00
parent 77cd712f10
commit 2ec73dee0f
3 changed files with 46 additions and 3 deletions

View file

@ -527,9 +527,17 @@ def get_booth_open():
return cfg.get('booth_open', True)
# ---------------------------------------------------------------------------
# MusicGPT API client
# ---------------------------------------------------------------------------
def get_musicgpt_autopoll_enabled():
"""Return True if automatic MusicGPT polling is enabled (default True)."""
cfg = load_booth_settings()
return cfg.get('musicgpt_autopoll', True)
def set_musicgpt_autopoll_enabled(enabled):
"""Persist the automatic MusicGPT polling toggle."""
cfg = load_booth_settings()
cfg['musicgpt_autopoll'] = bool(enabled)
save_booth_settings(cfg)
MUSICGPT_API_BASE = "https://api.musicgpt.com/api/public"