raise ValueError(f"Parameter block_level[]='{type(block_level)}' is not 'str'")
elif block_level == "":
raise ValueError("Parameter 'block_level' is empty")
- elif block_level in ["accept", "suspend", "silence"]:
+ elif block_level in ["accept", "suspend", "silence", "nsfw"]:
raise ValueError(f"block_level='{block_level}' is not wanted.")
logger.debug("Updating block reason='%s',blocker='%s',blocked='%s',block_level='%s'", reason, blocker, blocked, block_level)
raise ValueError(f"Parameter block_level[]='{type(block_level)}' is not 'str'")
elif block_level == "":
raise ValueError("Parameter 'block_level' is empty")
- elif block_level in ["accept", "suspend", "silence"]:
+ elif block_level in ["accept", "suspend", "silence", "nsfw"]:
raise ValueError(f"blocked='{blocked}' has unwanted block_level='{block_level}'")
database.cursor.execute(
raise ValueError(f"Parameter block_level[]='{type(block_level)}' is not of type 'str'")
elif block_level == "":
raise ValueError("Parameter 'block_level' is empty")
- elif block_level in ["accept", "suspend", "silence"]:
+ elif block_level in ["accept", "suspend", "silence", "nsfw"]:
raise ValueError(f"blocked='{blocked}' has unwanted block_level='{block_level}'")
if block_level is None:
raise Exception(f"blocker='{blocker}' is blacklisted but function invoked")
elif blacklist.is_blacklisted(blocked):
raise Exception(f"blocked='{blocked}' is blacklisted but function invoked")
- elif block_level in ["accept", "suspend", "silence"]:
+ elif block_level in ["accept", "suspend", "silence", "nsfw"]:
raise ValueError(f"blocked='{blocked}' has unwanted block_level='{block_level}'")
if reason is not None:
"followers-only" : "followers_only",
"media removal" : "media_removal",
"media_removal" : "media_removal",
- "media force-set as sensitive": "nsfw",
- "nsfw" : "nsfw",
+ "media force-set as sensitive": "media_nsfw",
+ "nsfw" : "media_nsfw",
"reject" : "reject",
"suspended servers": "reject",
"silenced servers" : "silenced",
- "removal from \"the whole known network\" timeline": " federated_timeline_removal",
+ "removal from \"the whole known network\" timeline": "federated_timeline_removal",
}
def fetch_blocks(domain: str, nodeinfo_url: str) -> list:
"filtered_media": [],
"followers_only": [],
"silenced" : [],
- "nsfw" : [],
+ "media_nsfw" : [],
"media_removal" : [],
+ "federated_timeline_removal": [],
}
logger.debug("doc[]='%s'", type(doc))
elif block_level == "suspend":
logger.debug("Block level 'suspend' has been changed to 'suspended'")
block_level = "suspended"
+ elif block_level == "nsfw":
+ logger.debug("Block level 'nsfw' has been changed to 'media_nsfw'")
+ block_level = "media_nsfw"
logger.debug("block_level='%s' - EXIT!", block_level)
return block_level