Convert generator to list for getFollowers()/getFollowing()
Fix SQL query in getFollowing()
This commit is contained in:
parent
1730a46ec3
commit
c78f40c179
1 changed files with 3 additions and 3 deletions
|
@ -51,7 +51,7 @@ def getMessages(db=dbtools.dbHelper(), two=twitools.twObject()):
|
|||
return mcount, savepoint or 0, db.getLatestMessage()
|
||||
|
||||
def getFollowers(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False):
|
||||
current = db.getFollowers()
|
||||
current = list(db.getFollowers())
|
||||
new = list(twitools.getNamesByIDs(twitools.getFollowerIDs()))
|
||||
gained = 0
|
||||
lost = 0
|
||||
|
@ -77,7 +77,7 @@ def getFollowers(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False)
|
|||
return gained, lost
|
||||
|
||||
def getFollowing(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False):
|
||||
current = db.getFollowing()
|
||||
current = list(db.getFollowing())
|
||||
new = list(twitools.getNamesByIDs(twitools.getFollowingIDs()))
|
||||
gained = 0
|
||||
lost = 0
|
||||
|
@ -94,7 +94,7 @@ def getFollowing(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False)
|
|||
|
||||
for following in current:
|
||||
if following not in new:
|
||||
db.executeQuery("UPDATE following SET `until` = %i WHERE `id` = %s AND `until` IS NULL" % (int(time.time()), following))
|
||||
db.executeQuery("UPDATE following SET `until` = %i WHERE `id` = '%s' AND `until` IS NULL" % (int(time.time()), following))
|
||||
print("You no longer follow: %s" % following)
|
||||
lost += 1
|
||||
|
||||
|
|
Loading…
Reference in a new issue