@@ -131,13 +131,16 @@ def get_latest_full():
131131 if not doc :
132132 return jsonify ({"exists" : False })
133133
134- return jsonify ({
135- "exists" : True ,
136- "gesture" : doc .get ("gesture" ),
137- "confidence" : doc .get ("confidence" ),
138- "handedness" : doc .get ("handedness" ),
139- "timestamp_display" : format_ts (doc .get ("timestamp" )),
140- })
134+ return jsonify (
135+ {
136+ "exists" : True ,
137+ "gesture" : doc .get ("gesture" ),
138+ "confidence" : doc .get ("confidence" ),
139+ "handedness" : doc .get ("handedness" ),
140+ "timestamp_display" : format_ts (doc .get ("timestamp" )),
141+ }
142+ )
143+
141144
142145@app .route ("/api/dashboard" )
143146def get_dashboard ():
@@ -156,19 +159,22 @@ def get_dashboard():
156159 cursor = events .find ().sort ("timestamp" , - 1 ).limit (50 )
157160
158161 for doc in cursor :
159- recent_clean .append ({
160- "timestamp_display" : format_ts (doc .get ("timestamp" )),
161- "gesture" : doc .get ("gesture" ) or "Unknown" ,
162- "confidence" : doc .get ("confidence" ),
163- "handedness" : doc .get ("handedness" ) or "N/A" ,
164- })
165-
166- return jsonify ({
167- "total_count" : total_count ,
168- "gesture_stats" : gesture_stats ,
169- "recent" : recent_clean
170- })
171-
162+ recent_clean .append (
163+ {
164+ "timestamp_display" : format_ts (doc .get ("timestamp" )),
165+ "gesture" : doc .get ("gesture" ) or "Unknown" ,
166+ "confidence" : doc .get ("confidence" ),
167+ "handedness" : doc .get ("handedness" ) or "N/A" ,
168+ }
169+ )
170+
171+ return jsonify (
172+ {
173+ "total_count" : total_count ,
174+ "gesture_stats" : gesture_stats ,
175+ "recent" : recent_clean ,
176+ }
177+ )
172178
173179
174180if __name__ == "__main__" :
0 commit comments