mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-11-25 08:38:59 +00:00
only display time til next post if bot is enabled
This commit is contained in:
parent
34c88984e8
commit
0df53877ab
1 changed files with 2 additions and 2 deletions
2
webui.py
2
webui.py
|
@ -52,7 +52,7 @@ def home():
|
|||
# multiple SELECTS is slow, maybe SELECT all at once and filter with python?
|
||||
c.execute("SELECT COUNT(*) FROM `bot_learned_accounts` WHERE bot_id = %s", (bot['handle'],))
|
||||
bot_users[bot['handle']] = c.fetchone()[0]
|
||||
c.execute("SELECT post_frequency - TIMESTAMPDIFF(MINUTE, last_post, CURRENT_TIMESTAMP()) FROM bots WHERE TIMESTAMPDIFF(MINUTE, last_post, CURRENT_TIMESTAMP()) <= post_frequency AND handle = %s", (bot['handle'],))
|
||||
c.execute("SELECT post_frequency - TIMESTAMPDIFF(MINUTE, last_post, CURRENT_TIMESTAMP()) FROM bots WHERE TIMESTAMPDIFF(MINUTE, last_post, CURRENT_TIMESTAMP()) <= post_frequency AND enabled = TRUE AND handle = %s", (bot['handle'],))
|
||||
next_post = c.fetchone()
|
||||
if next_post is not None:
|
||||
next_posts[bot['handle']] = next_post
|
||||
|
|
Loading…
Reference in a new issue