From d2985509f78896af12f5d27eca3c487789790c7a Mon Sep 17 00:00:00 2001 From: DecafDev <40307803+decaf-dev@users.noreply.github.com> Date: Fri, 26 Jul 2024 23:41:15 -0600 Subject: [PATCH] fix: correct size of bilibili links --- src/svelte/app/services/social-media-image.ts | 9 +++++++++ test-vault/.obsidian/plugins/vault-explorer/data.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/svelte/app/services/social-media-image.ts b/src/svelte/app/services/social-media-image.ts index 3ff4f58..960031c 100644 --- a/src/svelte/app/services/social-media-image.ts +++ b/src/svelte/app/services/social-media-image.ts @@ -102,6 +102,15 @@ export const fetchSocialImage = async (url: string) => { imageUrl = `https://${imageUrl}`; } + //Handle edge case where the url ends with @100w_100h_1c + //See issue #265 + if (imageUrl.endsWith("@100w_100h_1c.png")) { + imageUrl = imageUrl.replace( + /@100w_100h_1c.png$/, + "@425w_150h_1c.png" + ); + } + Logger.debug( { fileName: "social-media-image.ts", diff --git a/test-vault/.obsidian/plugins/vault-explorer/data.json b/test-vault/.obsidian/plugins/vault-explorer/data.json index cc022dc..3037dbf 100644 --- a/test-vault/.obsidian/plugins/vault-explorer/data.json +++ b/test-vault/.obsidian/plugins/vault-explorer/data.json @@ -104,6 +104,6 @@ "feed" ], "configDir": ".vaultexplorer", - "pluginVersion": "1.34.3", + "pluginVersion": "1.35.0", "logLevel": "trace" } \ No newline at end of file