Project started 🥂
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { getApiBaseUrl } from '../../config/runtime-config';
|
||||
|
||||
export function getStreamUrl(trackId: string, token: string): string {
|
||||
const base = getApiBaseUrl();
|
||||
return `${base}/streaming/tracks/${trackId}?token=${encodeURIComponent(token)}`;
|
||||
}
|
||||
|
||||
export function getCoverUrl(artUrl: string | undefined): string | undefined {
|
||||
if (!artUrl) return undefined;
|
||||
if (artUrl.startsWith('http://') || artUrl.startsWith('https://')) return artUrl;
|
||||
const base = getApiBaseUrl();
|
||||
return `${base}${artUrl}`;
|
||||
}
|
||||
Reference in New Issue
Block a user