fix panic

This commit is contained in:
orangix
2023-08-15 21:53:01 +02:00
parent 843008470a
commit 21ebabdde3

View File

@@ -173,7 +173,7 @@ func parseSubmission(value gjson.Result) Submission {
Url: strings.ReplaceAll(c.Get("url").String(), "https://i.imgur.com", ""), Url: strings.ReplaceAll(c.Get("url").String(), "https://i.imgur.com", ""),
} }
// Replace with thumbnails here because it's easier. // 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" cover.Url = cover.Url[:len(cover.Url)-3] + "webp"
} }
default: default: