Add toggle for automatic MusicGPT polling in settings
This commit is contained in:
parent
77cd712f10
commit
2ec73dee0f
3 changed files with 46 additions and 3 deletions
14
helpers.py
14
helpers.py
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue