Skip to content

Commit

Permalink
api(cdn): replace statically with uploadcare
Browse files Browse the repository at this point in the history
  • Loading branch information
gqgs committed Sep 30, 2022
1 parent 5a41540 commit a08e062
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/api/anilist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const parseCharacters = (characters?: APICharacterResult[]): SearchResult[] => {
mal_id: result.id,
title: result.name.full,
image_url: result.image.large
.replace("https://", "https://cdn.statically.io/img/")
.replace("https://", "https://a7c6b1b687e3f2ffe841.ucr.io/https://")
}
})
}
Expand All @@ -119,7 +119,7 @@ const parseMedia = (media?: APIMediaResult[]): SearchResult[] => {
mal_id: result.id,
title: result.title.romaji,
image_url: result.coverImage.extraLarge
.replace("https://", "https://cdn.statically.io/img/")
.replace("https://", "https://a7c6b1b687e3f2ffe841.ucr.io/https://")
}
})
}
2 changes: 1 addition & 1 deletion src/api/kitsu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class Kitsu extends API<APIResult> {
mal_id: result.id,
title: isMediaData(result) ? result.attributes.titles.en_jp : result.attributes.names.en,
image_url: (isMediaData(result) ? (result.attributes.posterImage.original || result.attributes.posterImage.large) : result.attributes?.image?.original ?? "")
.replace("https://", "https://cdn.statically.io/img/")
.replace("https://", "https://a7c6b1b687e3f2ffe841.ucr.io/https://")
}
}).filter(result => result.image_url.length > 0)
}
Expand Down

0 comments on commit a08e062

Please sign in to comment.