From b9865dce8cf6e1d6550d218f0b0e07a1787cb3da Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 09:17:58 +0000 Subject: [PATCH] Address code review feedback - Use hqdefault.jpg instead of maxresdefault.jpg (guaranteed to exist for all videos) - Extract thumbnail URL logic to GetThumbnailUrl method for better testability Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> --- .../Discord/Data/Embeds/YouTubeVideoEmbedProjection.cs | 6 +++++- .../Exporting/MessageGroupTemplate.cshtml | 5 +---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/DiscordChatExporter.Core/Discord/Data/Embeds/YouTubeVideoEmbedProjection.cs b/DiscordChatExporter.Core/Discord/Data/Embeds/YouTubeVideoEmbedProjection.cs index ec39bbb2..01abaf58 100644 --- a/DiscordChatExporter.Core/Discord/Data/Embeds/YouTubeVideoEmbedProjection.cs +++ b/DiscordChatExporter.Core/Discord/Data/Embeds/YouTubeVideoEmbedProjection.cs @@ -4,7 +4,11 @@ public partial record YouTubeVideoEmbedProjection(string VideoId) { public string Url { get; } = $"https://www.youtube.com/watch?v={VideoId}"; - public string ThumbnailUrl { get; } = $"https://i.ytimg.com/vi/{VideoId}/maxresdefault.jpg"; + // Using hqdefault.jpg which is guaranteed to exist for all YouTube videos + public string ThumbnailUrl { get; } = $"https://i.ytimg.com/vi/{VideoId}/hqdefault.jpg"; + + public string GetThumbnailUrl(Embed embed) => + embed.Thumbnail?.ProxyUrl ?? embed.Thumbnail?.Url ?? ThumbnailUrl; } public partial record YouTubeVideoEmbedProjection diff --git a/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml b/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml index 5e5741b4..4387a678 100644 --- a/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml +++ b/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml @@ -427,10 +427,7 @@ @* Video thumbnail *@