play video result done message working

parent e806a118
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -56,6 +56,70 @@ class DashboardAPI:
"timestamp": datetime.utcnow().isoformat()
}
def get_debug_match_status(self, fixture_id: str = None) -> Dict[str, Any]:
"""Get debug information about match statuses for troubleshooting"""
try:
session = self.db_manager.get_session()
try:
from ..database.models import MatchModel, MatchOutcomeModel, ExtractionStatsModel
# Get all matches or filter by fixture_id
query = session.query(MatchModel)
if fixture_id:
query = query.filter(MatchModel.fixture_id == fixture_id)
matches = query.order_by(MatchModel.match_number.desc()).limit(10).all()
debug_data = []
for match in matches:
match_data = {
"id": match.id,
"match_number": match.match_number,
"fixture_id": match.fixture_id,
"fighter1": match.fighter1_township,
"fighter2": match.fighter2_township,
"status": match.status,
"result": match.result,
"start_time": match.start_time.isoformat() if match.start_time else None,
"end_time": match.end_time.isoformat() if match.end_time else None,
"active_status": match.active_status
}
# Get outcomes
outcomes = session.query(MatchOutcomeModel).filter_by(match_id=match.id).all()
match_data["outcomes"] = [{"name": o.column_name, "value": o.float_value} for o in outcomes]
# Get extraction stats
extraction_stats = session.query(ExtractionStatsModel).filter_by(match_id=match.id).first()
if extraction_stats:
match_data["extraction_stats"] = {
"actual_result": extraction_stats.actual_result,
"extraction_result": extraction_stats.extraction_result,
"created_at": extraction_stats.created_at.isoformat()
}
else:
match_data["extraction_stats"] = None
debug_data.append(match_data)
return {
"success": True,
"debug_data": debug_data,
"fixture_id": fixture_id,
"timestamp": datetime.utcnow().isoformat()
}
finally:
session.close()
except Exception as e:
logger.error(f"Failed to get debug match status: {e}")
return {
"success": False,
"error": str(e),
"timestamp": datetime.utcnow().isoformat()
}
def get_video_status(self) -> Dict[str, Any]:
"""Get video player status"""
try:
......
......@@ -805,6 +805,18 @@ def system_status():
return jsonify({"error": str(e)}), 500
@api_bp.route('/debug/match-status')
def debug_match_status():
"""Get debug information about match statuses"""
try:
fixture_id = request.args.get('fixture_id')
debug_data = api_bp.api.get_debug_match_status(fixture_id)
return jsonify(debug_data)
except Exception as e:
logger.error(f"API debug match status error: {e}")
return jsonify({"error": str(e)}), 500
@api_bp.route('/video/status')
@api_bp.auth_manager.require_auth if hasattr(api_bp, 'auth_manager') and api_bp.auth_manager else login_required
def video_status():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment