From e369ec7fee31fb331f263b082afd91c1773482f8 Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Sun, 16 Feb 2025 12:50:08 +0100 Subject: [PATCH] feat: remove check if ID is included in featured threads For the home page's performance, I have commented out/taken out some old items in the featured threads list. To keep previously shared links working, I have removed this check --- threads.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/threads.py b/threads.py index ff6b19e..c3f0edc 100755 --- a/threads.py +++ b/threads.py @@ -15,7 +15,7 @@ thread_ids = [ '113650907203476875', '113449531956042438', '113300434695033812', - # '113210189309775644', + '113210189309775644', '113073168505436055', '112979161274124372', '112857903897175549', @@ -25,7 +25,7 @@ thread_ids = [ '112457129122626146', '112446314845243621', '112438729626526601', - '112410098697040344', + # '112410098697040344', # '112400284252533385', # '112365019457303644', # '112360396639315016', @@ -83,16 +83,13 @@ async def tag(id): @threads.route('/') @cache.cached(timeout=300) def thread(id): - if id in thread_ids: - attribution = get_attribution() - app = get_app_config() - status = fetch_thread(id) - status['summary'] = utils.clean_html(status['content']).strip() - if len(status['summary']) > 69: - status['summary'] = status['summary'][:69] + '...' - return render_template('_home.html', threads=[status], app=app, attribution=attribution, render_date=datetime.now()) - else: - return '

Not Found

🤷🤷‍♀️🤷‍♂️

go home', 404 + attribution = get_attribution() + app = get_app_config() + status = fetch_thread(id) + status['summary'] = utils.clean_html(status['content']).strip() + if len(status['summary']) > 69: + status['summary'] = status['summary'][:69] + '...' + return render_template('_home.html', threads=[status], app=app, attribution=attribution, render_date=datetime.now()) @threads.route('/api') @cache.cached(timeout=300)