From 1b351c9ad469014350d8abb092e33c9e3215805d Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 23 Dec 2020 16:38:43 +0300 Subject: Order tweets in the feed by highest score --- bh20simplewebuploader/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bh20simplewebuploader/main.py') diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index d697918..31d1b1f 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -263,7 +263,7 @@ def send_home(): # Ensure the dict always has a value; otherwise a key # error will be thrown by jinja tweet_dict = redis_client.hgetall(tweet_id) - if tweet_dict: + if tweet_dict and int(tweet_dict.get(b'score', "0")) > 0: tweets.append( {k.decode("utf-8"): v.decode("utf-8") for k, v in tweet_dict.items()}) -- cgit v1.2.3