Add image cache and use struct for config (closes #58)

This commit is contained in:
video-prize-ranch
2022-09-30 16:57:18 -04:00
parent f1c058cbfc
commit 4306b3bb81
9 changed files with 116 additions and 39 deletions

View File

@@ -33,7 +33,7 @@ func FetchComments(galleryID string) ([]Comment, error) {
return cacheData.([]Comment), nil
}
data, err := utils.GetJSON("https://api.imgur.com/comment/v1/comments?client_id=" + utils.Config["imgurId"].(string) + "&filter[post]=eq:" + galleryID + "&include=account,adconfig&per_page=30&sort=best")
data, err := utils.GetJSON("https://api.imgur.com/comment/v1/comments?client_id=" + utils.Config.ImgurId + "&filter[post]=eq:" + galleryID + "&include=account,adconfig&per_page=30&sort=best")
if err != nil {
return []Comment{}, nil
}