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:
parent
2ae5c7ac06
commit
c2f2682cce
2 changed files with 8 additions and 2 deletions
|
@ -55,7 +55,6 @@ requirements-parser = "^0.11.0"
|
||||||
|
|
||||||
[tool.poetry.extras]
|
[tool.poetry.extras]
|
||||||
client = ["minio", "pillow", "qrcode", "pymediainfo", "pyyaml", "pyqt6", "mpv", "qasync"]
|
client = ["minio", "pillow", "qrcode", "pymediainfo", "pyyaml", "pyqt6", "mpv", "qasync"]
|
||||||
server = ["alt-profanity-check"]
|
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["poetry-core"]
|
||||||
|
|
|
@ -28,7 +28,14 @@ from typing import Any, Callable, Literal, AsyncGenerator, Optional
|
||||||
|
|
||||||
import socketio
|
import socketio
|
||||||
from aiohttp import web
|
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
|
from syng.sources.source import EntryNotValid
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue