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:
18
Round.py
18
Round.py
@@ -15,8 +15,20 @@ class Round:
|
|||||||
self.losers = losers
|
self.losers = losers
|
||||||
self.winnerSide = winnerSide
|
self.winnerSide = winnerSide
|
||||||
if winnerSide == 2:
|
if winnerSide == 2:
|
||||||
self.winnerSideString = "Insurgent"
|
|
||||||
else:
|
|
||||||
self.winnerSideString = "Security"
|
self.winnerSideString = "Security"
|
||||||
self.mapName = mapName
|
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))
|
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,12 +126,9 @@ class DatabaseConnection:
|
|||||||
'''Get rounds played between two times'''
|
'''Get rounds played between two times'''
|
||||||
|
|
||||||
cursor = self.connRounds.cursor()
|
cursor = self.connRounds.cursor()
|
||||||
cursor.execute('''SELECT * FROM rounds WHERE timestamp between ? and ?''',
|
cursor.execute('''SELECT * FROM rounds WHERE timestamp between ? and ?
|
||||||
(start.timestamp(), end.timestamp()))
|
order by timestamp DESC''', (start.timestamp(), end.timestamp()))
|
||||||
|
|
||||||
print('''SELECT * FROM rounds WHERE timestamp between {} and {}'''.format(
|
|
||||||
start.timestamp(), end.timestamp()))
|
|
||||||
|
|
||||||
rounds = []
|
rounds = []
|
||||||
for row in cursor:
|
for row in cursor:
|
||||||
rounds += [Round.Round(row)]
|
rounds += [Round.Round(row)]
|
||||||
|
|||||||
@@ -33,6 +33,8 @@
|
|||||||
<th class="th-sm">Winner</th>
|
<th class="th-sm">Winner</th>
|
||||||
<th class="th-sm">Duration</th>
|
<th class="th-sm">Duration</th>
|
||||||
<th class="th-sm">Start Time</th>
|
<th class="th-sm">Start Time</th>
|
||||||
|
<th class="th-sm">Rating System Winner Prediction</th>
|
||||||
|
<th class="th-sm">Confidence</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -42,6 +44,8 @@
|
|||||||
<td>{{ r.winnerSideString }}</td>
|
<td>{{ r.winnerSideString }}</td>
|
||||||
<td>{{ r.duration }}</td>
|
<td>{{ r.duration }}</td>
|
||||||
<td>{{ r.startTime.strftime('%H:%M %d.%m.%Y') }}</td>
|
<td>{{ r.startTime.strftime('%H:%M %d.%m.%Y') }}</td>
|
||||||
|
<td>{{ r.prediction }}</td>
|
||||||
|
<td>{{ r.confidence }}%</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user