Updated per backend change
This commit is contained in:
parent
9ea32b8747
commit
bd2148b5c1
@ -181,12 +181,15 @@ class YandereBot(FediBot.YandereBot):
|
||||
else:
|
||||
self.print_header_stats(None)
|
||||
|
||||
def post(self, picked):
|
||||
def post(self, callback=None):
|
||||
picked = None
|
||||
reinsert_image = False
|
||||
try:
|
||||
return super(YandereBot, self).post(picked)
|
||||
picked = self.pick()
|
||||
return super(YandereBot, self).post(lambda: picked)
|
||||
# Attempted to post a file that doesn't exist (immediately repost ignoring retry_seconds)
|
||||
except (FileNotFoundError, FediBot.InvalidPost):
|
||||
if picked:
|
||||
print("File not found:", picked["picked"].get_hash_path())
|
||||
reinsert_image = False
|
||||
|
||||
@ -211,7 +214,7 @@ class YandereBot(FediBot.YandereBot):
|
||||
# Exception flags
|
||||
reinsert_image = True
|
||||
|
||||
if reinsert_image and self.consecutive_failed_uploads < self.settings["settings_behavior"]["max_errors"]:
|
||||
if picked and reinsert_image and self.consecutive_failed_uploads < self.settings["settings_behavior"]["max_errors"]:
|
||||
self.listPictures.insert(0, picked["picked"])
|
||||
|
||||
self.handle_post_exception()
|
||||
|
Reference in New Issue
Block a user