fix panic

This commit is contained in:
orangix 2023-08-15 21:53:01 +02:00
parent 843008470a
commit 21ebabdde3
No known key found for this signature in database
GPG Key ID: C31D4A86601C8416

View File

@ -173,7 +173,7 @@ func parseSubmission(value gjson.Result) Submission {
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" {
if strings.HasSuffix(cover.Url, ".mp4") {
cover.Url = cover.Url[:len(cover.Url)-3] + "webp"
}
default: