User reported the NSFW toggle was not appearing, then asked to remove it entirely. For a solo home-NAS deploy a global blur layer adds no value — if the user wants to filter, the existing `/api/media?nsfw=` query param still works. Removed - Two header buttons: NSFW 👁/🙈 and Discreto 🤫/👁 - The discreet-banner above the alerts - body x-data + x-init (no longer needed without the store) - filter-nsfw select from the gallery header - nsfwFilter param building from loadGallery's URL - isNsfw / nsfwBadge / thumbClass branching in appendToGallery (every gallery thumb now just gets class "gallery-thumb") - Alpine.store('prefs') registration and the autoDiscreet IIFE - CSS blocks: .nsfw-thumb, .show-nsfw, .nsfw-badge, .discreet, and .discreet-banner Kept - posts.nsfw column populated from Reddit's over_18 - GET /api/media?nsfw=all|hide|only query param + corresponding Database filtering - over18=1 cookie on the requests Session - PIN lock and 🔒 Lock header button (independent feature) Bump 1.5.3 -> 1.5.4 (patch — UI removal, no backend or contract change). 151 tests + ruff + mypy still green; grep confirms zero showNsfw / nsfw-thumb / discreet / autoDiscreet references left in src/web/.
100 lines
2.2 KiB
TOML
100 lines
2.2 KiB
TOML
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src"]
|
|
|
|
[project]
|
|
name = "reddit-media-collector"
|
|
version = "1.5.4"
|
|
description = "Self-hosted media collector for Reddit with Immich integration"
|
|
readme = "README.md"
|
|
requires-python = ">=3.11"
|
|
license = "MIT"
|
|
dependencies = [
|
|
"requests>=2.31.0",
|
|
"pyyaml>=6.0",
|
|
"yt-dlp>=2024.0.0",
|
|
"fastapi>=0.109.0",
|
|
"uvicorn>=0.27.0",
|
|
"jinja2>=3.1.0",
|
|
"python-multipart>=0.0.9",
|
|
"apscheduler>=3.10.0",
|
|
"sqlalchemy>=2.0.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8.0.0",
|
|
"pytest-cov>=5.0.0",
|
|
"pytest-asyncio>=0.23.0",
|
|
"httpx>=0.27.0",
|
|
"ruff>=0.4.0",
|
|
"mypy>=1.10.0",
|
|
"types-requests>=2.31.0",
|
|
"types-PyYAML>=6.0",
|
|
"pre-commit>=3.7.0",
|
|
]
|
|
|
|
[project.scripts]
|
|
reddit-collector = "src.main:main"
|
|
|
|
[tool.ruff]
|
|
target-version = "py311"
|
|
line-length = 120
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
"E", # pycodestyle errors
|
|
"W", # pycodestyle warnings
|
|
"F", # pyflakes
|
|
"I", # isort
|
|
"N", # pep8-naming
|
|
"UP", # pyupgrade
|
|
"B", # flake8-bugbear
|
|
"SIM", # flake8-simplify
|
|
"TCH", # flake8-type-checking
|
|
"RUF", # ruff-specific rules
|
|
]
|
|
ignore = [
|
|
"E501", # line too long (handled by formatter)
|
|
"B008", # do not perform function calls in argument defaults (FastAPI uses this)
|
|
]
|
|
|
|
[tool.ruff.lint.isort]
|
|
known-first-party = ["src"]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.11"
|
|
warn_return_any = true
|
|
warn_unused_configs = true
|
|
disallow_untyped_defs = false
|
|
check_untyped_defs = true
|
|
ignore_missing_imports = true
|
|
|
|
# Legacy modules still being typed gradually — keep them out of strict mode
|
|
# until they get their cleanup pass. New code under src/web/ is held to the
|
|
# default strictness.
|
|
[[tool.mypy.overrides]]
|
|
module = [
|
|
"src.main",
|
|
"src.downloader",
|
|
"src.reddit_client",
|
|
"src.database",
|
|
"src.extractors.reddit",
|
|
]
|
|
ignore_errors = true
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
pythonpath = ["."]
|
|
addopts = "-v --tb=short"
|
|
|
|
[tool.coverage.run]
|
|
source = ["src"]
|
|
omit = ["src/web/templates/*"]
|
|
|
|
[tool.coverage.report]
|
|
show_missing = true
|
|
skip_empty = true
|