Skip to content

Commit 0af8298

Browse files
committed
settings: SUPPORTED_GAMETYPES -> ENABLED_GAMETYPES
1 parent 2341ec3 commit 0af8298

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

qllr/blueprints/balance_api/methods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from qllr.db import cache
88
from qllr.settings import (
99
AVG_PERF_GAMETYPES,
10+
ENABLED_GAMETYPES,
1011
INITIAL_R1_MEAN,
1112
INITIAL_R2_VALUE,
12-
SUPPORTED_GAMETYPES,
1313
)
1414
from qllr.submission import get_map_id
1515

@@ -107,7 +107,7 @@ async def fetch(
107107
players = {}
108108
for steam_id in map(str, steam_ids):
109109
players[steam_id] = {"steamid": steam_id}
110-
for gametype in SUPPORTED_GAMETYPES:
110+
for gametype in ENABLED_GAMETYPES:
111111
players[steam_id][gametype] = {
112112
"games": 0,
113113
"elo": INITIAL_R1_MEAN[gametype]

qllr/settings.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
config = Config(".env")
88

9-
SUPPORTED_GAMETYPES = ("ad", "ca", "ctf", "ft", "tdm", "tdm2v2")
9+
ENABLED_GAMETYPES = config(
10+
"ENABLED_GAMETYPES", cast=CommaSeparatedStrings, default=list(GAMETYPE_RULES.keys())
11+
)
1012
DATABASE_URL = str(config("DATABASE_URL", cast=URL))
1113
HOST = config("HOST", default="127.0.0.1")
1214
PORT = config("PORT", cast=int, default=7081)
@@ -21,8 +23,9 @@
2123
INITIAL_R1_DEVIATION = {}
2224
MIN_PLAYER_COUNT_IN_MATCH_TO_RATE = {}
2325
USE_AVG_PERF = {}
24-
for gt in SUPPORTED_GAMETYPES:
25-
MIN_PLAYER_COUNT_IN_MATCH_TO_RATE[gt] = config(
26+
for gt in ENABLED_GAMETYPES:
27+
rules = GAMETYPE_RULES[gt]
28+
MIN_PLAYER_COUNT_IN_MATCH_TO_RATE[gt] = rules.override_min_player_count() or config(
2629
"MIN_PLAYER_COUNT_IN_MATCH_TO_RATE_{}".format(gt.upper()), cast=int, default=6
2730
)
2831
USE_AVG_PERF[gt] = config(
@@ -37,4 +40,4 @@
3740

3841
INITIAL_R2_VALUE = INITIAL_R1_MEAN.copy()
3942

40-
AVG_PERF_GAMETYPES = [gt for gt in SUPPORTED_GAMETYPES if USE_AVG_PERF[gt]]
43+
AVG_PERF_GAMETYPES = [gt for gt in ENABLED_GAMETYPES if USE_AVG_PERF[gt]]

0 commit comments

Comments
 (0)