Browse Source

Minor logic cleanup

Kirk Trombley 6 years ago
parent
commit
97ba425eeb
1 changed files with 7 additions and 5 deletions
  1. 7 5
      app.py

+ 7 - 5
app.py

@@ -66,13 +66,15 @@ def get_users():
 
     users = []
     for name, info in client_info.items():
-        addl_text = []
+        user_text = name
+        audio_status = []
         if info["client_info"].get("client_input_muted", "0") == "1":
-            addl_text.append("Mic muted")
+            audio_status.append("Mic muted")
         if info["client_info"].get("client_output_muted", "0") == "1":
-            addl_text.append("Sound muted")
-        notes = ", ".join(addl_text)
-        users.append(name if len(notes) == 0 else f"{name} ({notes})")
+            audio_status.append("Sound muted")
+        if len(audio_status) > 0:
+            user_text += f" ({', '.join(audio_status)})"
+        users.append(user_text)
 
     return users