Corrected after_pick() logic

This commit is contained in:
Anon 2023-03-12 20:16:44 -07:00
parent 958265e82b
commit 53b2dd456d

View File

@ -125,11 +125,13 @@ 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):
profile, frame, nsfw, path = None, None, None, None profile, frame, nsfw, path = None, None, None, None
if picked: if picked:
profile = picked.profile_name profile = picked.profile_name
frame = picked.picked_frame frame = picked.picked_frame
nsfw = picked.is_nsfw() nsfw = picked.is_nsfw()
path = picked.output_name_tr path = picked.output_name_tr
print("Profile: {} | Frame: {} | NSFW: {} | Path: {}".format( print("Profile: {} | Frame: {} | NSFW: {} | Path: {}".format(
profile, frame, nsfw, path profile, frame, nsfw, path
)) ))
@ -151,7 +153,10 @@ class YandereBot(FediBot.YandereBot):
} }
def after_pick(self, picked): def after_pick(self, picked):
self.print_header_stats(picked["picked"]) if picked:
self.print_header_stats(picked["picked"])
else:
self.print_header_stats(None)
def post(self, picked): def post(self, picked):
try: try: