Fix: style issue, types

This commit is contained in:
Pieter Vander Vennet 2024-07-19 11:57:53 +02:00
parent 3c20d2ca8d
commit 5932dc7ad4
7 changed files with 71 additions and 73 deletions

View file

@ -97,11 +97,11 @@ export class Imgur extends ImageProvider implements ImageUploader {
const hash = url.substr("https://i.imgur.com/".length).split(/\.jpe?g/i)[0]
const apiUrl = "https://api.imgur.com/3/image/" + hash
const response = await Utils.downloadJsonCached(apiUrl, 365 * 24 * 60 * 60, {
const response = await Utils.downloadJsonCached<{data: {description: string, datetime: string, views: number}}>(apiUrl, 365 * 24 * 60 * 60, {
Authorization: "Client-ID " + Constants.ImgurApiKey,
})
const descr: string = response.data.description ?? ""
const descr = response.data.description ?? ""
const data: any = {}
const imgurData = response.data