Corrected after_pick() logic

This commit is contained in:
Anon 2023-03-12 20:16:35 -07:00
parent d0ffc76b6d
commit 140c125fcc

View File

@ -149,10 +149,14 @@ class YandereBot(FediBot.YandereBot):
# Maybe I should remove this from the backend? # Maybe I should remove this from the backend?
def print_header_stats(self, picked): def print_header_stats(self, picked):
_picked = picked.get_full_string() if picked else None picked_profile, _picked, picked_next_profile, picked_next = None, None, None, None
picked_profile = picked.get_post_setting()["name"] if picked else None if picked:
picked_next = self.listPictures[0].get_full_string() if self.listPictures else None _picked = picked.get_full_string()
picked_next_profile = self.listPictures[0].get_post_setting()["name"] if self.listPictures else None picked_profile = picked.get_post_setting()["name"]
if self.listPictures:
picked_next = self.listPictures[0].get_full_string()
picked_next_profile = self.listPictures[0].get_post_setting()["name"]
print("Profile: {} | Picked: {} | Next_Profile: {} | Next_Pick: {}".format( print("Profile: {} | Picked: {} | Next_Profile: {} | Next_Pick: {}".format(
picked_profile, _picked, picked_next_profile, picked_next picked_profile, _picked, picked_next_profile, picked_next
@ -171,8 +175,11 @@ class YandereBot(FediBot.YandereBot):
} }
def after_pick(self, picked): def after_pick(self, picked):
if picked:
self.blacklist(picked["picked"]) self.blacklist(picked["picked"])
self.print_header_stats(picked["picked"]) self.print_header_stats(picked["picked"])
else:
self.print_header_stats(None)
def post(self, picked): def post(self, picked):
reinsert_image = False reinsert_image = False