remove recommendation by default on / endpoint. this was causing some unintended confusion, e.g. the search function was using time_filter 7 and giving bad results from the main page. also getting recommendations takes time and is slowish, so only do it on actual demand

This commit is contained in:
Andrej Karpathy
2021-12-18 20:21:04 -08:00
parent 0f21e69125
commit 4210a73d15
+6 -14
View File
@@ -200,21 +200,13 @@ def default_context():
@app.route('/', methods=['GET'])
def main():
# when someone logged in hits the default '/' page, set some helpful
# GET option defaults based on whether or not the user is logged in
if g.user and len(request.args) == 0:
# user is logged in: show recommendations over recent papers
default_rank = 'tags'
default_tags = 'all'
default_time_filter = '7'
default_skip_have = 'yes'
else:
# a not logged in user: simply show recent papers
default_rank = 'time'
default_tags = ''
default_time_filter = ''
default_skip_have = 'no'
# default settings
default_rank = 'time'
default_tags = ''
default_time_filter = ''
default_skip_have = 'no'
# override variables with any provided options via the interface
opt_rank = request.args.get('rank', default_rank) # rank type. search|tags|pid|time|random
opt_q = request.args.get('q', '') # search request in the text box
opt_tags = request.args.get('tags', default_tags) # tags to rank by if opt_rank == 'tag'