feat: add solo and co-op taste profiles
Filter recommendation candidates and taste weights by play context, with taste_profile in the API, --taste in the CLI and a selector in the UI.
This commit is contained in:
1 parent
02af4bde09
commit
54a7b36aae
12 files changed
+105
-4
No files matched your search
@@ -1479,6 +1479,10 @@ class Handler(BaseHTTPRequestHandler):
|
||||
time_of_day = body.get("time_of_day")
|
||||
if time_of_day not in {"morning", "day", "evening", "night"}:
|
||||
time_of_day = None
|
||||
taste_profile = body.get("taste_profile") or None
|
||||
if taste_profile not in reco.TASTE_PROFILES and taste_profile is not None:
|
||||
self._error(400, "unknown taste profile")
|
||||
return
|
||||
mood, results = reco.recommend(
|
||||
con, mood,
|
||||
allowed_statuses=allowed,
|
||||
@@ -1489,6 +1493,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
feedback_key=key,
|
||||
session=session,
|
||||
time_of_day=time_of_day,
|
||||
taste_profile=taste_profile,
|
||||
)
|
||||
ids = [g["appid"] for g in results]
|
||||
details = details_map(con, ids)
|
||||
|
||||
Reference in new issue
Block a user