File size: 1,413 Bytes
c6abe34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import sys
import os
import asyncio

# Ensure we can import from 'app'
sys.path.append(os.getcwd())

from app.services.supabase_client import get_supabase_service


async def check():
    supabase = get_supabase_service()

    # Search for video with title containing 'defence'
    videos = await supabase.select("videos", filters={})
    for v in videos:
        if "defence" in v.get("title", "").lower():
            print(f"ID: {v.get('id')}")
            print(f"Title: {v.get('title')}")
            print(f"Status: {v.get('status')}")
            print(f"Annotated URL: {v.get('annotated_url')}")
            print(f"Storage Path: {v.get('storage_path')}")
            
            # Check analysis results
            results = await supabase.select("analysis_results", filters={"video_id": v.get("id")})
            if results:
                r = results[0]
                print(f"Analysis Status: completed")
                print(f"Total Frames: {r.get('total_frames')}")
                print(f"Players Detected: {r.get('players_detected')}")
                print(f"Total Passes: {r.get('total_passes')}")
                print(f"Interceptions: {r.get('total_interceptions')}")
                print(f"Shot Attempts: {r.get('shot_attempts')}")
            else:
                print("Analysis Results: None found")
            print("-" * 20)


if __name__ == "__main__":
    asyncio.run(check())