fix #17 ignore fav on retweets
im not sure how it works on mastodon so i just took the safe option
This commit is contained in:
parent
3c6a9e4158
commit
f2cdc30c9e
8
tasks.py
8
tasks.py
|
@ -177,8 +177,8 @@ def delete_from_account(account_id):
|
|||
if posts:
|
||||
eligible = list(( # nosec
|
||||
post for post in posts if
|
||||
(not account.policy_keep_favourites or not post.favourite)
|
||||
and (not account.policy_keep_media or not post.has_media)
|
||||
(not account.policy_keep_favourites or not post.favourite or post.is_reblog)
|
||||
and (not account.policy_keep_media or not post.has_media or post.is_reblog)
|
||||
))
|
||||
if eligible:
|
||||
to_delete = random.choice(eligible)
|
||||
|
@ -187,8 +187,8 @@ def delete_from_account(account_id):
|
|||
for post in posts:
|
||||
refreshed = refresh_posts((post,))
|
||||
if refreshed and \
|
||||
(not account.policy_keep_favourites or not post.favourite) \
|
||||
and (not account.policy_keep_media or not post.has_media)\
|
||||
(not account.policy_keep_favourites or not post.favourite or post.is_reblog) \
|
||||
and (not account.policy_keep_media or not post.has_media or post.is_reblog)\
|
||||
and (not account.policy_keep_direct or not post.direct):
|
||||
to_delete = refreshed[0]
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue