#!/bin/bash # Single Frame FS Configuration Test Script FILE_UUID="4655a0ab3c077e30c12b2298c2750650" API_KEY="muser_68600856036340bcafc01930eb4bd839_1774418104_97221b69" API_URL="http://localhost:3002" echo "==============================================" echo " Single Frame FS Configuration Test" echo "==============================================" echo "" echo "【Test 1: Get Face Groups (default config)】" echo "Expected: 5 multi-trace groups, 10 single-trace groups filtered" curl -s -H "Authorization: Bearer $API_KEY" \ "$API_URL/api/v1/file/$FILE_UUID/face-groups" | python3 -m json.tool echo "" echo "【Test 2: Disable single trace group filter】" echo "Updating face_filter..." PG_BIN="/opt/homebrew/opt/libpq/bin" $PG_BIN/psql -U accusys -d momentry -h localhost << SQL UPDATE videos SET face_filter = jsonb_set( face_filter, '{single_trace_group_filter_enabled}', 'false' ) WHERE file_uuid = '$FILE_UUID'; SQL echo "" echo "Expected: All 15 groups (including single-trace groups)" curl -s -H "Authorization: Bearer $API_KEY" \ "$API_URL/api/v1/file/$FILE_UUID/face-groups" | python3 -m json.tool echo "" echo "【Test 3: Disable single frame trace from groups】" $PG_BIN/psql -U accusys -d momentry -h localhost << SQL UPDATE videos SET face_filter = jsonb_set( jsonb_set( face_filter, '{single_trace_group_filter_enabled}', 'true' ), '{single_frame_trace_group_enabled}', 'false' ) WHERE file_uuid = '$FILE_UUID'; SQL echo "" echo "Expected: Fewer groups (single frame traces excluded)" curl -s -H "Authorization: Bearer $API_KEY" \ "$API_URL/api/v1/file/$FILE_UUID/face-groups" | python3 -m json.tool echo "" echo "【Test 4: Check unassigned traces】" echo "Restoring default config..." $PG_BIN/psql -U accusys -d momentry -h localhost << SQL UPDATE videos SET face_filter = jsonb_set( face_filter, '{single_frame_trace_group_enabled}', 'true' ) WHERE file_uuid = '$FILE_UUID'; SQL echo "" echo "Getting unassigned traces..." curl -s -H "Authorization: Bearer $API_KEY" \ "$API_URL/api/v1/traces/unassigned?file_uuid=$FILE_UUID" | python3 -m json.tool | head -50 echo "" echo "✅ Test Complete"