mirror of
https://github.com/FAUSheppy/open-web-leaderboard.git
synced 2025-12-06 07:01:36 +01:00
minor fixes
This commit is contained in:
16
Round.py
16
Round.py
@@ -15,8 +15,20 @@ class Round:
|
||||
self.losers = losers
|
||||
self.winnerSide = winnerSide
|
||||
if winnerSide == 2:
|
||||
self.winnerSideString = "Insurgent"
|
||||
else:
|
||||
self.winnerSideString = "Security"
|
||||
self.loserSideString = "Insurgent"
|
||||
else:
|
||||
self.winnerSideString = "Insurgent"
|
||||
self.loserSideString = "Security"
|
||||
if mapName:
|
||||
self.mapName = mapName
|
||||
else:
|
||||
self.mapName = "unavailiable"
|
||||
self.duration = datetime.timedelta(seconds=int(duration))
|
||||
if prediction == 0:
|
||||
self.prediction = self.winnerSideString
|
||||
elif prediction == 1:
|
||||
self.prediction = self.loserSideString
|
||||
else:
|
||||
self.prediction = "Error"
|
||||
self.confidence = int(confidence * 100)
|
||||
|
||||
@@ -126,11 +126,8 @@ class DatabaseConnection:
|
||||
'''Get rounds played between two times'''
|
||||
|
||||
cursor = self.connRounds.cursor()
|
||||
cursor.execute('''SELECT * FROM rounds WHERE timestamp between ? and ?''',
|
||||
(start.timestamp(), end.timestamp()))
|
||||
|
||||
print('''SELECT * FROM rounds WHERE timestamp between {} and {}'''.format(
|
||||
start.timestamp(), end.timestamp()))
|
||||
cursor.execute('''SELECT * FROM rounds WHERE timestamp between ? and ?
|
||||
order by timestamp DESC''', (start.timestamp(), end.timestamp()))
|
||||
|
||||
rounds = []
|
||||
for row in cursor:
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
<th class="th-sm">Winner</th>
|
||||
<th class="th-sm">Duration</th>
|
||||
<th class="th-sm">Start Time</th>
|
||||
<th class="th-sm">Rating System Winner Prediction</th>
|
||||
<th class="th-sm">Confidence</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -42,6 +44,8 @@
|
||||
<td>{{ r.winnerSideString }}</td>
|
||||
<td>{{ r.duration }}</td>
|
||||
<td>{{ r.startTime.strftime('%H:%M %d.%m.%Y') }}</td>
|
||||
<td>{{ r.prediction }}</td>
|
||||
<td>{{ r.confidence }}%</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user