feat(media): port MediaViewer ratings and visible-only tag counts

MediaViewer committed these changes to its vendored shared copy
(e83afad, ca8a89e) without upstreaming them, so the next shared sync
would have removed them from MediaViewer and broken its build.

Ported here as a three-way merge against 74942e5, the snapshot
MediaViewer last synced from:

- media.MediaRecord.Rating, read in FindMedia and returned by ToJSON,
  with the rating column added in migrate.go
- tagSuggestions counts media items through the library's visibility
  rules instead of raw media_tags rows
- MediaPlayer autoplayMuted prop (defaults to false, so existing
  callers are unaffected)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
GabrielandClaude Haiku 5.5 committed 2026-11-13 17:46:55 +01:00
1 parent 61d8da5fb3
commit 60befcd883
3 files changed
+26 -4

No files matched your search

+2
View File
@@ -74,6 +74,7 @@ var migrationStatements = []string{
size_bytes BIGINT,
is_vr BOOLEAN NOT NULL DEFAULT FALSE,
has_funscript BOOLEAN NOT NULL DEFAULT FALSE,
rating TEXT,
funscript_action_count INT,
funscript_avg_speed REAL,
funscript_max_speed REAL,
@@ -82,6 +83,7 @@ var migrationStatements = []string{
modified_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
)`,
`ALTER TABLE media ADD COLUMN IF NOT EXISTS content_scanner_processed BOOLEAN NOT NULL DEFAULT FALSE`,
`ALTER TABLE media ADD COLUMN IF NOT EXISTS rating TEXT`,
`ALTER TABLE media ADD COLUMN IF NOT EXISTS funscript_action_count INT`,
`ALTER TABLE media ADD COLUMN IF NOT EXISTS funscript_avg_speed REAL`,
`ALTER TABLE media ADD COLUMN IF NOT EXISTS funscript_max_speed REAL`,