Stream refreshed media for playback and view full

This commit is contained in:
Fisto
2026-09-16 13:18:55 +02:00
parent d3f9d20190
commit 612b2504dc
9 changed files with 207 additions and 18 deletions
+5
View File
@@ -21,6 +21,8 @@ export interface ExtractedMedia {
kind: MediaKind;
url: string;
source: MediaSource;
/** Direct playable file URL when the embed carries one (gifv/Tenor mp4). */
playUrl: string | null;
provider: string | null;
contentType: string | null;
size: number | null;
@@ -73,6 +75,7 @@ function extractEmbed(embed: CoreEmbed): ExtractedMedia | null {
const provider = embed.provider ?? hostname(embed.url);
const common = {
source: "embed" as const,
playUrl: embed.videoUrl ?? null,
provider,
downloaded: false,
size: null,
@@ -123,6 +126,7 @@ function extractSticker(sticker: CoreSticker): ExtractedMedia | null {
return {
kind: ext === "gif" ? "gif" : "image",
source: "sticker",
playUrl: null,
url: `https://cdn.discordapp.com/stickers/${sticker.id}.${ext}`,
provider: "discord",
contentType: null,
@@ -145,6 +149,7 @@ function extractFrom(message: MediaMessage): ExtractedMedia[] {
items.push({
kind,
source: "attachment",
playUrl: null,
url: attachment.url,
provider: "discord",
contentType: attachment.contentType,