Remove createVideoURL func

This commit is contained in:
WardPearce
2026-03-03 19:54:23 +13:00
parent 6c3efe5cfa
commit 87883da133
2 changed files with 9 additions and 15 deletions
@@ -15,10 +15,10 @@
VideoBase,
VideoWatchHistory
} from '$lib/api/model';
import { createVideoUrl } from '$lib/misc';
import type { PlayerEvents } from '$lib/player';
import {
deArrowEnabledStore,
isAndroidTvStore,
playerSavePlaybackPositionStore,
playerState,
rawMasterKeyStore,
@@ -38,7 +38,14 @@
let { video = $bindable(), playlistId = '', sideways = $bindable(false) }: Props = $props();
let watchUrl = createVideoUrl(video.videoId, playlistId);
const watchPath = resolve(`/${get(isAndroidTvStore) ? 'tv' : 'watch'}/[videoId]`, {
videoId: video.videoId
});
const watchUrl = new URL(`${location.origin}${watchPath}`);
if (playlistId !== '') {
watchUrl.searchParams.set('playlist', playlistId);
}
let beenWatched: boolean = $state(false);
-13
View File
@@ -178,19 +178,6 @@ export function expandSummery(id: string) {
}
}
export function createVideoUrl(videoId: string, playlistId: string): URL {
const watchPath = resolve(`/${get(isAndroidTvStore) ? 'tv' : 'watch'}/[videoId]`, {
videoId: videoId
});
const watchUrl = new URL(`${location.origin}${watchPath}`);
if (playlistId !== '') {
watchUrl.searchParams.set('playlist', playlistId);
}
return watchUrl;
}
export function timeout(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}