Update.
This commit is contained in:
+5
-4
@@ -24,7 +24,7 @@ function getYoutubeVideoId(url) {
|
||||
}
|
||||
|
||||
function getYoutubeThumbnail(videoId) {
|
||||
return `https://img.youtube.com/vi/${videoId}/hqdefault.jpg`;
|
||||
return `/api/proxy-image?url=${encodeURIComponent(`https://img.youtube.com/vi/${videoId}/hqdefault.jpg`)}`;
|
||||
}
|
||||
|
||||
function getYoutubeEmbedUrl(videoId) {
|
||||
@@ -86,17 +86,18 @@ function isDevrantImageUrl(url) {
|
||||
}
|
||||
|
||||
function buildDevrantImageUrl(imagePath) {
|
||||
if (!imagePath) return null;
|
||||
if (imagePath.startsWith('http')) {
|
||||
return imagePath;
|
||||
return `/api/proxy-image?url=${encodeURIComponent(imagePath)}`;
|
||||
}
|
||||
return `https://img.devrant.com/${imagePath}`;
|
||||
return `/api/proxy-image?url=${encodeURIComponent(`https://img.devrant.com/${imagePath}`)}`;
|
||||
}
|
||||
|
||||
function buildAvatarUrl(avatar) {
|
||||
if (!avatar || !avatar.i) {
|
||||
return null;
|
||||
}
|
||||
return `https://avatars.devrant.com/${avatar.i}`;
|
||||
return `/api/proxy-image?url=${encodeURIComponent(`https://avatars.devrant.com/${avatar.i}`)}`;
|
||||
}
|
||||
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user