Use CloudFront for media to avoid payload limits

This commit is contained in:
video-prize-ranch
2022-01-28 17:55:44 -05:00
parent 65e5711766
commit 668df16fd2
2 changed files with 14 additions and 1 deletions

View File

@@ -59,6 +59,10 @@ func ParseAlbum(data gjson.Result) (types.Album, error) {
url := value.Get("url").String()
url = strings.ReplaceAll(url, "https://i.imgur.com", "")
if strings.HasSuffix(url, "mp4") || viper.GetBool("CF_ALL_MEDIA") {
url = viper.GetString("CF_MEDIA_DISTRIBUTION") + url
}
media = append(media, types.Media{
Id: value.Get("id").String(),
Name: value.Get("name").String(),