1.1.0: Updated Profile

This commit is contained in:
2026-01-26 18:36:47 +08:00
parent 727105f11e
commit 8cc359b0ec
20 changed files with 856 additions and 251 deletions

View File

@@ -118,11 +118,14 @@ def detail(steam_id):
comments = WebService.get_comments('player', steam_id)
metadata = WebService.get_player_metadata(steam_id)
# Roster Distribution Stats
distribution = StatsService.get_roster_stats_distribution(steam_id)
# History for table (L2 Source) - Fetch ALL for history table/chart
history_asc = StatsService.get_player_trend(steam_id, limit=1000)
history = history_asc[::-1] if history_asc else []
return render_template('players/profile.html', player=player, features=features, comments=comments, metadata=metadata, history=history)
return render_template('players/profile.html', player=player, features=features, comments=comments, metadata=metadata, history=history, distribution=distribution)
@bp.route('/comment/<int:comment_id>/like', methods=['POST'])
def like_comment(comment_id):
@@ -151,9 +154,14 @@ def charts_data(steam_id):
trend_labels = []
trend_values = []
for t in trends:
dt = datetime.fromtimestamp(t['start_time']) if t['start_time'] else datetime.now()
trend_labels.append(dt.strftime('%Y-%m-%d'))
match_indices = []
for i, row in enumerate(trends):
t = dict(row) # Convert sqlite3.Row to dict
# Format: Match #Index (Map)
# Use backend-provided match_index if available, or just index + 1
idx = t.get('match_index', i + 1)
map_name = t.get('map_name', 'Unknown')
trend_labels.append(f"#{idx} {map_name}")
trend_values.append(t['rating'])
return jsonify({