From ae712309d2e8455ab5708143ea2f9bdd49ac072c Mon Sep 17 00:00:00 2001 From: Precific Date: Sun, 2 Nov 2025 19:30:11 +0100 Subject: [PATCH] Minor code quality --- materialious/src/lib/misc.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/materialious/src/lib/misc.ts b/materialious/src/lib/misc.ts index b182a4af..d2829709 100644 --- a/materialious/src/lib/misc.ts +++ b/materialious/src/lib/misc.ts @@ -25,18 +25,17 @@ export function decodeHtmlCharCodes(str: string): string { } export function proxyVideoUrl(source: string): string { - const rawSrc = new URL(source); - const instURLStr = get(instanceStore); - const instURL = new URL(instURLStr); - rawSrc.host = instURL.host; - rawSrc.protocol = instURL.protocol; + let videoUrl = new URL(source); + const instURL = new URL(get(instanceStore)); + videoUrl.host = instURL.host; + videoUrl.protocol = instURL.protocol; let pathPrefix = instURL.pathname; if (pathPrefix.endsWith("/")) { pathPrefix = pathPrefix.substring(0, pathPrefix.length - 1); } - rawSrc.pathname = pathPrefix + rawSrc.pathname; + videoUrl.pathname = pathPrefix + videoUrl.pathname; - return rawSrc.toString(); + return videoUrl.toString(); } export function unsafeRandomItem(array: any[]): any {