Forum: the link module, with YouTube previews

- services/forum/src/links: recognises the links in a post and shows a
  preview for the ones a provider knows; for now YouTube (watch, shorts,
  live, embed and youtu.be links, with the start time). Title and channel
  come from YouTube's oEmbed answer, the thumbnail is cut to 16:9 and kept
  in our own storage, so reading a thread loads nothing from YouTube. Made
  when a post is written or edited; without it the link stays text.
- The card: on a computer a click plays the video in place
  (youtube-nocookie.com); on a phone it opens the YouTube app (Android:
  an intent with the web page as fallback; iOS: the link the app takes
  over), and "Lejátszás itt" plays it in place.
- The privacy notice (HU, EN) says what YouTube sees when one plays it.
- "Pörgős most" is now "Élénk beszélgetések"; the new thread form lost its
  note about text and emoji.
- docs: the Turnstile captcha is on the list before going live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-26 16:26:37 +00:00
co-authored by Claude Opus 5.5
parent 493539bf56
commit 1d4f18b5d6
21 changed files with 653 additions and 26 deletions
+16
View File
@@ -121,6 +121,22 @@ export interface ForumPost {
muted?: boolean;
/** A chart, forecast or synastry shared with the question. */
share?: ShareCardData | null;
/** Previews of the links a provider knows (YouTube for now). */
links?: LinkPreview[] | null;
}
/** A link the forum's link module knows, under a post. */
export interface LinkPreview {
provider: "youtube";
id: string;
/** As written in the post. */
url: string;
/** Where to start playing, in seconds. */
start: number | null;
title: string;
author: string | null;
/** Our own copy of the thumbnail. */
thumbnail: string | null;
}
/** A shared chart in a post: in full for members, `locked` for visitors, `revoked` when taken down. */