This commit is contained in:
1 parent
facacfb751
commit
2dbe457836
12 files changed
+75
-11
No files matched your search
@@ -1117,6 +1117,9 @@ class Handler(BaseHTTPRequestHandler):
|
||||
session = body.get("session")
|
||||
if session not in {"short", "evening", "weekend"}:
|
||||
session = None
|
||||
time_of_day = body.get("time_of_day")
|
||||
if time_of_day not in {"morning", "day", "evening", "night"}:
|
||||
time_of_day = None
|
||||
mood, results = reco.recommend(
|
||||
con, mood,
|
||||
allowed_statuses=allowed,
|
||||
@@ -1126,6 +1129,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
limit=min(100, int(body.get("limit", 36))),
|
||||
feedback_key=key,
|
||||
session=session,
|
||||
time_of_day=time_of_day,
|
||||
)
|
||||
ids = [g["appid"] for g in results]
|
||||
details = details_map(con, ids)
|
||||
|
||||
@@ -963,6 +963,7 @@ async function runRecommend(scroll = true) {
|
||||
include_nostalgia: $("#optNostalgia").checked,
|
||||
min_review: Number($("#optReview").value),
|
||||
session: $("#optSession").value || null,
|
||||
time_of_day: $("#optTimeOfDay").value || null,
|
||||
limit: 36,
|
||||
};
|
||||
state.recommendContext = { preset: state.preset, mood: state.preset ? null : text };
|
||||
|
||||
@@ -301,6 +301,15 @@ try {
|
||||
<option value="weekend">выходные</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="range">сутки
|
||||
<select id="optTimeOfDay" aria-label="Время суток">
|
||||
<option value="">не учитывать</option>
|
||||
<option value="morning">утро</option>
|
||||
<option value="day">день</option>
|
||||
<option value="evening">вечер</option>
|
||||
<option value="night">ночь</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<button id="recommendBtn" class="primary">Подобрать</button>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user