diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8add8913..bdaca924 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,6 @@ repos: rev: 24.4.2 hooks: - id: black - exclude: ^hordelib/nodes/.*\..*$ - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.4.3 hooks: diff --git a/CHANGELOG.md b/CHANGELOG.md index 31d20bb4..7ba76e5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ SPDX-License-Identifier: AGPL-3.0-or-later # Changelog +# 4.43.2 + +* Horde more accurately reports which images are nsfw or csam censored + # 4.43.1 * Fix to prevent limit_max_steps picking up WPs with empty model lists diff --git a/horde/classes/stable/processing_generation.py b/horde/classes/stable/processing_generation.py index 87808d80..94d9360a 100644 --- a/horde/classes/stable/processing_generation.py +++ b/horde/classes/stable/processing_generation.py @@ -78,9 +78,12 @@ def log_aborted_generation(self): ) def set_generation(self, generation, things_per_sec, **kwargs): - if kwargs.get("censored", False): - self.censored = True state = kwargs.get("state", "ok") + for metadata in kwargs.get("gen_metadata", []): + if metadata.get('value') == 'csam': + state = 'csam' + else: + state = 'censored' if state in ["censored", "csam"]: self.censored = True db.session.commit() diff --git a/horde/consts.py b/horde/consts.py index dc316a71..a8dc6c8b 100644 --- a/horde/consts.py +++ b/horde/consts.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: AGPL-3.0-or-later -HORDE_VERSION = "4.43.1 " +HORDE_VERSION = "4.43.2 " WHITELISTED_SERVICE_IPS = { "212.227.227.178", # Turing Bot