bugfix themes for soundboard

This commit is contained in:
oberon 2026-02-18 22:08:26 +01:00
parent 21c0b13b8d
commit 1658321b67

View File

@ -282,7 +282,15 @@ def api_play_sound():
# Sounds zusammenstellen: lokalspezifisch + globale Default-Sounds # Sounds zusammenstellen: lokalspezifisch + globale Default-Sounds
config_sounds = state.current_config.get('sounds', []) if state.current_config else [] config_sounds = state.current_config.get('sounds', []) if state.current_config else []
global_sounds = load_default_sounds(current_app.config['CONFIG_DIR']) global_sounds = load_default_sounds(current_app.config['CONFIG_DIR'])
all_sounds = list(config_sounds) + list(global_sounds) sb_sounds = []
if state.current_soundboard:
for key in ('backgrounds', 'sounds', 'random_pool'):
sb_sounds.extend(state.current_soundboard.get(key, []))
# IDs sicherstellen
for s in sb_sounds:
s.setdefault('id', s.get('file'))
all_sounds = list(config_sounds) + list(global_sounds) + sb_sounds
if not all_sounds: if not all_sounds:
return jsonify({"success": False, "message": "Keine Sounds konfiguriert"}), 400 return jsonify({"success": False, "message": "Keine Sounds konfiguriert"}), 400