Small fix on search

This commit is contained in:
pluja 2020-09-11 10:40:02 +02:00
parent a3f4d89781
commit 10a0a8ee76
2 changed files with 2 additions and 6 deletions

View File

@ -225,20 +225,16 @@ def ytsearch():
form = ChannelForm() form = ChannelForm()
button_form = EmptyForm() button_form = EmptyForm()
if form.validate_on_submit(): if form.validate_on_submit():
channels = []
videos = []
searchTerms = form.channelId.data searchTerms = form.channelId.data
page = 1 page = 1
autocorrect = 1 autocorrect = 1
sort = 0 sort = 0
filters = {"time":0, "type":0, "duration":0} filters = {"time":0, "type":0, "duration":0}
results = yts.search_by_terms(searchTerms, page, autocorrect, sort, filters) results = yts.search_by_terms(searchTerms, page, autocorrect, sort, filters)
return render_template('ytsearch.html', form=form, btform=button_form, results=results, restricted=config['restrictPublicUsage'], config=config) return render_template('ytsearch.html', form=form, btform=button_form, results=results, restricted=config['restrictPublicUsage'], config=config)
else: else:
return render_template('ytsearch.html', form=form) return render_template('ytsearch.html', form=form, results=False)
@app.route('/ytfollow/<channelId>', methods=['POST']) @app.route('/ytfollow/<channelId>', methods=['POST'])
@login_required @login_required

View File

@ -14,7 +14,7 @@
<p>{{ form.submit() }}</p> <p>{{ form.submit() }}</p>
</form> </form>
{% if results.channels %} {% if results %}
<h3 class="ui dividing header">Users</h3> <h3 class="ui dividing header">Users</h3>
<div class="ui relaxed divided list"> <div class="ui relaxed divided list">