fix: use public mq url for public stuff
This commit is contained in:
parent
76021dcf70
commit
fff0144fd4
@ -1,4 +1,6 @@
|
|||||||
|
import { PUBLIC_MUSIKQUAD_SERVER } from '$env/dynamic/public';
|
||||||
import { LOCAL_MUSIKQUAD_SERVER } from '$env/static/private';
|
import { LOCAL_MUSIKQUAD_SERVER } from '$env/static/private';
|
||||||
|
import { scheme } from '../../../utils';
|
||||||
|
|
||||||
interface MusicInfo {
|
interface MusicInfo {
|
||||||
title: string,
|
title: string,
|
||||||
@ -7,12 +9,11 @@ interface MusicInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function load({ params }) {
|
export async function load({ params }) {
|
||||||
const server = LOCAL_MUSIKQUAD_SERVER;
|
const resp = await fetch(`${LOCAL_MUSIKQUAD_SERVER}/share/info/${params.token}`);
|
||||||
const resp = await fetch(`${server}/share/info/${params.token}`);
|
|
||||||
const info: MusicInfo = await resp.json();
|
const info: MusicInfo = await resp.json();
|
||||||
return {
|
return {
|
||||||
info,
|
info,
|
||||||
thumbnail_url: `${server}/share/thumbnail/${params.token}`,
|
thumbnail_url: `${scheme}://${PUBLIC_MUSIKQUAD_SERVER}/share/thumbnail/${params.token}`,
|
||||||
audio_url: `${server}/share/audio/${params.token}`,
|
audio_url: `${scheme}://${PUBLIC_MUSIKQUAD_SERVER}/share/audio/${params.token}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user