Dependency alt-profanity-check is now optional due.

If it is present, it is used otherwise no profanity check is performed.
This is due to the complexity of installing alt-profanity-check and only
affects the server.
This commit is contained in:
Christoph Stahl 2025-02-15 11:34:31 +01:00
parent 2ae5c7ac06
commit c2f2682cce
2 changed files with 8 additions and 2 deletions

View file

@ -55,7 +55,6 @@ requirements-parser = "^0.11.0"
[tool.poetry.extras]
client = ["minio", "pillow", "qrcode", "pymediainfo", "pyyaml", "pyqt6", "mpv", "qasync"]
server = ["alt-profanity-check"]
[build-system]
requires = ["poetry-core"]

View file

@ -28,7 +28,14 @@ from typing import Any, Callable, Literal, AsyncGenerator, Optional
import socketio
from aiohttp import web
from profanity_check import predict
try:
from profanity_check import predict
except ImportError:
# If the profanity_check package is not installed, use a dummy function
def predict(strings: list[str]) -> list[Literal[0, 1]]:
return [0]
from syng.sources.source import EntryNotValid