minor fixes

This commit is contained in:
Yannik Schmidt
2020-09-29 07:56:29 +02:00
parent a630cddb13
commit 59aaa672c1
3 changed files with 21 additions and 8 deletions

View File

@@ -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)

View File

@@ -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:

View File

@@ -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>