Use generator comprehension instead of list comprehension for ?q.

This commit is contained in:
voussoir 2020-08-11 21:50:38 -07:00
parent e90254cfeb
commit be45de55f5

View file

@ -45,7 +45,7 @@ def get_channel(channel_id=None, download_filter=None):
search_terms = request.args.get('q', '').lower().strip().replace('+', ' ').split() search_terms = request.args.get('q', '').lower().strip().replace('+', ' ').split()
if search_terms: if search_terms:
videos = [v for v in videos if all(term in v.title.lower() for term in search_terms)] videos = (v for v in videos if all(term in v.title.lower() for term in search_terms))
limit = request.args.get('limit', None) limit = request.args.get('limit', None)
if limit is not None: if limit is not None: