From 54293f4c45eab77147628db51e954bfe117f2551 Mon Sep 17 00:00:00 2001 From: AzuTear Date: Thu, 25 Jun 2026 09:59:47 +0200 Subject: [PATCH] Embed clips in admin review --- .../components/admin/useAdminClipManager.ts | 5 ++ frontend/src/views/admin/AdminClipsView.vue | 83 ++++++++++++------- 2 files changed, 57 insertions(+), 31 deletions(-) diff --git a/frontend/src/components/admin/useAdminClipManager.ts b/frontend/src/components/admin/useAdminClipManager.ts index 4bb3704..3cc4a2e 100644 --- a/frontend/src/components/admin/useAdminClipManager.ts +++ b/frontend/src/components/admin/useAdminClipManager.ts @@ -1,6 +1,7 @@ import { computed, reactive, ref, watch } from 'vue' import { CheckCircle2, Film, Layers3, PlayCircle } from '@lucide/vue' +import { buildClipEmbed, type ClipEmbed } from '../../lib/clipEmbeds' import { useAwardsStore } from '../../stores/awards' import type { AdminClipSubmissionItem } from '../../types/awards' @@ -37,6 +38,9 @@ export function useAdminClipManager() { (!search || [clip.title, clip.creator, clip.platform, clip.submittedByTwitchId, clip.clipUrl].join(' ').toLowerCase().includes(search)), ) }) + const clipEmbeds = computed>(() => + Object.fromEntries(submissions.value.map((clip) => [clip.id, buildClipEmbed(clip.clipUrl)])), + ) const duplicateUrls = computed(() => { const counts = new Map() for (const clip of submissions.value) { @@ -150,6 +154,7 @@ export function useAdminClipManager() { submissions, categoryName, clips, + clipEmbeds, stats, statusFilters, platformFilters, diff --git a/frontend/src/views/admin/AdminClipsView.vue b/frontend/src/views/admin/AdminClipsView.vue index 8115b75..da5b520 100644 --- a/frontend/src/views/admin/AdminClipsView.vue +++ b/frontend/src/views/admin/AdminClipsView.vue @@ -22,6 +22,7 @@ const { submissions, categoryName, clips, + clipEmbeds, stats, statusFilters, platformFilters, @@ -95,39 +96,59 @@ const {

{{ adminError }}

-
-
- +
+
+
+ +
+
+

{{ clip.title || 'Ohne Titel' }}

+

+ {{ clip.creator || 'Unbekannt' }} + · {{ categoryName[clip.categoryId] }} + · von {{ clip.submittedByTwitchId }} +

+
+ {{ clip.platform }} + {{ statusLabel(clip.status) }} + + Clip öffnen + +
+

+ Mögliches Duplikat: diese URL wurde {{ duplicateUrlCount(clip.clipUrl) }}x eingereicht. +

+

+ Sammelpunkt: {{ creatorClipCount(clip) }} Clips für diese Person oder diesen Kandidaten. +

+

+ Zuletzt geprüft von {{ clip.reviewedByTwitchId || 'Admin' }} · {{ new Date(clip.reviewedAt).toLocaleString('de-DE') }} +

+
-
-

{{ clip.title || 'Ohne Titel' }}

-

- {{ clip.creator || 'Unbekannt' }} - · {{ categoryName[clip.categoryId] }} - · von {{ clip.submittedByTwitchId }} -

-

- Mögliches Duplikat: diese URL wurde {{ duplicateUrlCount(clip.clipUrl) }}x eingereicht. -

-

- Sammelpunkt: {{ creatorClipCount(clip) }} Clips für diese Person oder diesen Kandidaten. -

-

- Zuletzt geprüft von {{ clip.reviewedByTwitchId || 'Admin' }} · {{ new Date(clip.reviewedAt).toLocaleString('de-DE') }} -

+
+
+