You need to sign in or sign up before continuing.

play video result done message working

parent e806a118
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -32,13 +32,13 @@ class DashboardAPI: ...@@ -32,13 +32,13 @@ class DashboardAPI:
try: try:
# Get configuration status # Get configuration status
config_status = self.config_manager.validate_configuration() config_status = self.config_manager.validate_configuration()
# Get database status # Get database status
db_status = self.db_manager.get_connection_status() db_status = self.db_manager.get_connection_status()
# Get component status (cached or from message bus) # Get component status (cached or from message bus)
components_status = self._get_components_status() components_status = self._get_components_status()
return { return {
"status": "online", "status": "online",
"timestamp": datetime.utcnow().isoformat(), "timestamp": datetime.utcnow().isoformat(),
...@@ -47,7 +47,7 @@ class DashboardAPI: ...@@ -47,7 +47,7 @@ class DashboardAPI:
"database": db_status, "database": db_status,
"components": components_status "components": components_status
} }
except Exception as e: except Exception as e:
logger.error(f"Failed to get system status: {e}") logger.error(f"Failed to get system status: {e}")
return { return {
...@@ -55,6 +55,70 @@ class DashboardAPI: ...@@ -55,6 +55,70 @@ class DashboardAPI:
"error": str(e), "error": str(e),
"timestamp": datetime.utcnow().isoformat() "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]: def get_video_status(self) -> Dict[str, Any]:
"""Get video player status""" """Get video player status"""
......
...@@ -805,6 +805,18 @@ def system_status(): ...@@ -805,6 +805,18 @@ def system_status():
return jsonify({"error": str(e)}), 500 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.route('/video/status')
@api_bp.auth_manager.require_auth if hasattr(api_bp, 'auth_manager') and api_bp.auth_manager else login_required @api_bp.auth_manager.require_auth if hasattr(api_bp, 'auth_manager') and api_bp.auth_manager else login_required
def video_status(): 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