Fixes for Pleroma: Empty strings mean no CW, oi['object']['id']
compares to uri
field in db
This commit is contained in:
parent
6393ccb9e0
commit
56a5a3fff5
1 changed files with 3 additions and 3 deletions
6
main.py
6
main.py
|
@ -183,14 +183,14 @@ for f in following:
|
||||||
|
|
||||||
# its a toost baby
|
# its a toost baby
|
||||||
content = oi['object']['content']
|
content = oi['object']['content']
|
||||||
if oi['object']['summary'] != None:
|
if oi['object']['summary'] != None and oi['object']['summary'] != "":
|
||||||
#don't download CW'd toots
|
#don't download CW'd toots
|
||||||
continue
|
continue
|
||||||
toot = extract_toot(content)
|
toot = extract_toot(content)
|
||||||
# print(toot)
|
# print(toot)
|
||||||
try:
|
try:
|
||||||
if pleroma:
|
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
|
#we've caught up to the notices we've already downloaded, so we can stop now
|
||||||
done = True
|
done = True
|
||||||
break
|
break
|
||||||
|
@ -224,4 +224,4 @@ print("Done!")
|
||||||
db.commit()
|
db.commit()
|
||||||
db.execute("VACUUM") #compact db
|
db.execute("VACUUM") #compact db
|
||||||
db.commit()
|
db.commit()
|
||||||
db.close()
|
db.close()
|
||||||
|
|
Loading…
Reference in a new issue