From 843008470ad5797f6f1e8b16f20766c06ade0d12 Mon Sep 17 00:00:00 2001 From: orangix Date: Tue, 15 Aug 2023 21:03:13 +0200 Subject: [PATCH] replace video with thumbnail --- api/user.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/user.go b/api/user.go index a497b4d..b7d39a7 100644 --- a/api/user.go +++ b/api/user.go @@ -172,6 +172,10 @@ func parseSubmission(value gjson.Result) Submission { Id: c.Get("id").String(), Url: strings.ReplaceAll(c.Get("url").String(), "https://i.imgur.com", ""), } + // Replace with thumbnails here because it's easier. + if cover.Url[len(cover.Url)-3:] == "mp4" { + cover.Url = cover.Url[:len(cover.Url)-3] + "webp" + } default: cover = Media{ Id: value.Get("id").String(),