def _send_yt_queries_index_and_search(self) -> None:
with DbConn() as conn:
quota_count = QuotaLog.current(conn)
- queries_data = YoutubeQuery.get_all(conn)
+ queries_data = [
+ q for q in YoutubeQuery.get_all(conn)
+ if q.retrieved_at > self.server.config.queries_cutoff]
queries_data.sort(key=lambda q: q.retrieved_at, reverse=True)
self._send_rendered_template(_NAME_TEMPLATE_QUERIES,
{'queries': queries_data,
'host': '127.0.0.1', # NB: to be found remotely, use '0.0.0.0'!
'port': 8090,
'port_remote': 8090,
- 'background_color': '#ffffff'
+ 'background_color': '#ffffff',
+ 'queries_cutoff': ''
}
# type definitions for mypy
port_remote: int
api_key: str
background_color: str
+ queries_cutoff: str
def __init__(self):
def set_attrs_from_dict(d):