adds the option to only remove boosts
This commit is contained in:
parent
45fd4a90af
commit
345621411c
|
@ -191,6 +191,7 @@ def init():
|
||||||
conf_url = compulsory_input(tags, "Base URL", "(e.g. example.social):")
|
conf_url = compulsory_input(tags, "Base URL", "(e.g. example.social):")
|
||||||
conf_days = digit_input(tags, "Days to keep", "(default 365):")
|
conf_days = digit_input(tags, "Days to keep", "(default 365):")
|
||||||
conf_pinned = yes_no_input(tags, "Keep pinned toots?")
|
conf_pinned = yes_no_input(tags, "Keep pinned toots?")
|
||||||
|
conf_boosts_only = yes_no_input(tags, "Only remove boosted toots?")
|
||||||
conf_keep_toots = optional_input(
|
conf_keep_toots = optional_input(
|
||||||
tags, "Toots to keep", "(optional list of IDs separated by commas):"
|
tags, "Toots to keep", "(optional list of IDs separated by commas):"
|
||||||
)
|
)
|
||||||
|
@ -215,6 +216,7 @@ def init():
|
||||||
configfile.write("\n base_url: " + conf_url)
|
configfile.write("\n base_url: " + conf_url)
|
||||||
configfile.write("\n days_to_keep: " + conf_days)
|
configfile.write("\n days_to_keep: " + conf_days)
|
||||||
configfile.write("\n keep_pinned: " + conf_pinned)
|
configfile.write("\n keep_pinned: " + conf_pinned)
|
||||||
|
configfile.write("\n boosts_only: " + conf_boosts_only)
|
||||||
|
|
||||||
if len(conf_keep_toots) > 0:
|
if len(conf_keep_toots) > 0:
|
||||||
keep_list = conf_keep_toots.split(",")
|
keep_list = conf_keep_toots.split(",")
|
||||||
|
@ -399,6 +401,7 @@ def retry_on_error(options, mastodon, toot, attempts):
|
||||||
def process_toot(config, options, mastodon, deleted_count, toot):
|
def process_toot(config, options, mastodon, deleted_count, toot):
|
||||||
|
|
||||||
keep_pinned = "keep_pinned" in config and config["keep_pinned"]
|
keep_pinned = "keep_pinned" in config and config["keep_pinned"]
|
||||||
|
boosts_only = "boosts_only" in config and config["boosts_only"]
|
||||||
toots_to_keep = config["toots_to_keep"] if "toots_to_keep" in config else []
|
toots_to_keep = config["toots_to_keep"] if "toots_to_keep" in config else []
|
||||||
visibility_to_keep = (
|
visibility_to_keep = (
|
||||||
config["visibility_to_keep"] if "visibility_to_keep" in config else []
|
config["visibility_to_keep"] if "visibility_to_keep" in config else []
|
||||||
|
@ -466,7 +469,7 @@ def process_toot(config, options, mastodon, deleted_count, toot):
|
||||||
|
|
||||||
mastodon.status_unreblog(toot.reblog)
|
mastodon.status_unreblog(toot.reblog)
|
||||||
|
|
||||||
else:
|
if not boosts_only:
|
||||||
console_print(
|
console_print(
|
||||||
"❌ deleting toot " + str(toot.id) + " tooted " + tooted_date(toot),
|
"❌ deleting toot " + str(toot.id) + " tooted " + tooted_date(toot),
|
||||||
options,
|
options,
|
||||||
|
@ -587,11 +590,11 @@ def check_batch(config, options, mastodon, user_id, timeline, deleted_count=0):
|
||||||
except IndexError:
|
except IndexError:
|
||||||
if not options.quiet or options.quiet <= 1:
|
if not options.quiet or options.quiet <= 1:
|
||||||
print(
|
print(
|
||||||
"No toots found for "
|
"No toots found for "
|
||||||
+ config["username"]
|
+ config["username"]
|
||||||
+ "@"
|
+ "@"
|
||||||
+ config["base_url"]
|
+ config["base_url"]
|
||||||
+ ".\n"
|
+ ".\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue