Conversation
Adds an optional third param to uploadToS3 so callers with a stable ID (e.g., a slug) can override the URL-derived hash key with a human-readable filename. Existing callers unaffected. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Adds a daily Trigger.dev task that downloads YouTube video thumbnails to S3, keyed by slug. Tries sddefault.jpg first, falls back to hqdefault.jpg. customThumbnailUrl takes priority when set. Wires the thumbnail map into getVideos() with a graceful fallback to the YouTube URL when the map is missing, so the gallery still renders before the first sync runs (or if it fails). Follows the existing fetchApps/fetchEvents pattern for data-layer, task registration, getters, and cached wrappers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
Gallery cards now rely entirely on the S3 thumbnail map; the pre-S3 fallback to img.youtube.com is removed along with the getDefaultThumbnailUrl helper and the img.youtube.com entry in next.config.js remotePatterns. JSON-LD thumbnailUrl is inlined with the canonical YouTube URL (customThumbnailUrl || hqdefault.jpg) since structured data is consumed by crawlers as a plain string and doesn't pass through Next.js Image optimization. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: wackerow <54227730+wackerow@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds a daily Trigger.dev task that downloads video thumbnails from YouTube (or customThumbnailUrl) to our S3 bucket, and wires the /videos gallery to serve those S3-hosted images instead of hitting img.youtube.com directly.
Motivation
YouTube's thumbnail CDN is inconsistent:
sddefault.jpg(best quality) returns 404 for some videoshqdefault.jpgis the documented "guaranteed" fallback but has been flaky in practice (broken thumbnails observed on production /videos recently)onErrorcan fire -- so a transient YouTube 404 becomes a broken image users seeSyncing to S3 solves this with a single reliable origin, and gives us the progressive-quality pick (sd > hq) at sync time instead of render time.
Follows the existing
fetchApps/fetchEvents/ developer-tools pattern.Changes
New
src/data-layer/fetchers/fetchVideoThumbnails.ts-- daily task. For each video: uploadscustomThumbnailUrlif present, else triessddefault.jpgand falls back tohqdefault.jpg. Keyed by slug so each video maps to exactly one S3 object.VIDEO_THUMBNAILSkey + registration insrc/data-layer/tasks.tsDAILYgetVideoThumbnails()getter insrc/data-layer/index.tssrc/lib/data/index.tsModified
src/data-layer/s3.ts--uploadToS3gains an optionalcustomFilename3rd param so callers with a stable ID (e.g., slug) can override the URL-derived hash key with a human-readable filename. Existing callers unaffected.src/lib/utils/videos.ts--getVideos()fetches the thumbnail map in parallel with the slug scan;toVideoCardData()uses the S3 URL.getDefaultThumbnailUrl()removed.app/[locale]/videos/[slug]/page-jsonld.tsx--thumbnailUrlinlined to point at the canonical YouTube URL (JSON-LD is plain string metadata for crawlers, doesn't pass through Next.js Image).next.config.js--img.youtube.comremoved fromremotePatterns(no longer rendered via Next.js Image anywhere).Ops notes
getVideos()has a graceful fallback (.catch(() => null)), so a missing/empty map doesn't break the page -- but cards won't show thumbnails until the sync has run.Test plan
fetch-video-thumbnailstask in Trigger.dev dev environmentvideos/thumbnails/<slug>.jpgfor each video/videoslocally and confirm gallery cards use S3 URLs/videos/[slug]page and inspect JSON-LD --thumbnailUrlshould be a YouTube URLGenerated by Claude (Opus 4.7)