Add an ephemeral similarity check page

- /similar (nav: Similar): drop a file to get the exact MD5 match, the
  perceptual matches against the library, and e621 IQDB candidates
  (auto-run for images when credentials are configured). Read-only —
  nothing enters the library.
- SimilarityCheck model + /api/similarity/ (create/list/retrieve/delete)
  with signed preview URLs and an expires_at timestamp.
- Temp files are wiped on startup (AppConfig.ready, file-only so no
  database access during initialization), lazily past
  SIMILARITY_TTL_MINUTES (default 30, env-overridable), on delete, and
  by manage.py cleanup_similarity.
- uploadFile() takes a target path; .env.example documents the TTL.
This commit is contained in:
2026-09-17 18:22:11 -05:00
parent cea34422ec
commit 1c2cb8d468
15 changed files with 875 additions and 5 deletions
+2
View File
@@ -10,6 +10,7 @@ from .tools import (
VisualGroupsView,
VisualMatchesView,
)
from .similarity import SimilarityCheckViewSet
from .uploads import TempUploadViewSet
from .views import (
ClientDownloadView,
@@ -23,6 +24,7 @@ router.register("files", MediaItemViewSet, basename="file")
router.register("uploads", TempUploadViewSet, basename="upload")
router.register("online/downloads", DownloadTaskViewSet, basename="download")
router.register("matches", MatchTaskViewSet, basename="match")
router.register("similarity", SimilarityCheckViewSet, basename="similarity")
urlpatterns = [
path("", include(router.urls)),