From 56a5a3fff58ddc27270cd4f10608d406cf622f14 Mon Sep 17 00:00:00 2001 From: QBFreak Date: Sat, 29 Dec 2018 18:58:43 -0500 Subject: [PATCH] Fixes for Pleroma: Empty strings mean no CW, `oi['object']['id']` compares to `uri` field in db --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 560df61..63c2a4c 100755 --- a/main.py +++ b/main.py @@ -183,14 +183,14 @@ for f in following: # its a toost baby content = oi['object']['content'] - if oi['object']['summary'] != None: + if oi['object']['summary'] != None and oi['object']['summary'] != "": #don't download CW'd toots continue toot = extract_toot(content) # print(toot) try: if pleroma: - if c.execute("SELECT COUNT(*) FROM toots WHERE id LIKE ?", (oi['object']['id'],)).fetchone()[0] > 0: + if c.execute("SELECT COUNT(*) FROM toots WHERE uri LIKE ?", (oi['object']['id'],)).fetchone()[0] > 0: #we've caught up to the notices we've already downloaded, so we can stop now done = True break @@ -224,4 +224,4 @@ print("Done!") db.commit() db.execute("VACUUM") #compact db db.commit() -db.close() \ No newline at end of file +db.close()