Move blacklist check above whitelist check
This commit is contained in:
@ -219,6 +219,12 @@ def send_to_discord(custom_reader: Reader | None = None, feed: Feed | None = Non
|
|||||||
# Create the webhook.
|
# Create the webhook.
|
||||||
webhook: DiscordWebhook = DiscordWebhook(url=webhook_url, content=webhook_message, rate_limit_retry=True)
|
webhook: DiscordWebhook = DiscordWebhook(url=webhook_url, content=webhook_message, rate_limit_retry=True)
|
||||||
|
|
||||||
|
# Check if the entry is blacklisted, if it is, mark it as read and continue.
|
||||||
|
if should_be_skipped(reader, entry):
|
||||||
|
logger.info("Entry was blacklisted: %s", entry.id)
|
||||||
|
reader.set_entry_read(entry, True)
|
||||||
|
continue
|
||||||
|
|
||||||
# Check if the feed has a whitelist, and if it does, check if the entry is whitelisted.
|
# Check if the feed has a whitelist, and if it does, check if the entry is whitelisted.
|
||||||
if has_white_tags(reader, entry.feed):
|
if has_white_tags(reader, entry.feed):
|
||||||
if should_be_sent(reader, entry):
|
if should_be_sent(reader, entry):
|
||||||
@ -231,12 +237,6 @@ def send_to_discord(custom_reader: Reader | None = None, feed: Feed | None = Non
|
|||||||
reader.set_entry_read(entry, True)
|
reader.set_entry_read(entry, True)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Check if the entry is blacklisted, if it is, mark it as read and continue.
|
|
||||||
if should_be_skipped(reader, entry):
|
|
||||||
logger.info("Entry was blacklisted: %s", entry.id)
|
|
||||||
reader.set_entry_read(entry, True)
|
|
||||||
continue
|
|
||||||
|
|
||||||
# It was not blacklisted, and not forced through whitelist, so we will send it to Discord.
|
# It was not blacklisted, and not forced through whitelist, so we will send it to Discord.
|
||||||
response: Response = webhook.execute()
|
response: Response = webhook.execute()
|
||||||
if response.status_code not in {200, 204}:
|
if response.status_code not in {200, 204}:
|
||||||
|
Reference in New Issue
Block a user