Reslove fixes

This commit is contained in:
WardPearce
2025-11-20 20:52:51 +13:00
parent f7cdad7530
commit 454c73e6b4
27 changed files with 130 additions and 89 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "Materialious",
"version": "1.11.6",
"version": "1.11.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "Materialious",
"version": "1.11.6",
"version": "1.11.7",
"license": "MIT",
"dependencies": {
"@capacitor-community/electron": "^5.0.0",
+2 -1
View File
@@ -24,6 +24,7 @@
"dependencies": {
"@capacitor-community/electron": "^5.0.0",
"bgutils-js": "^3.2.0",
"capacitor-nodejs": "https://github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.9/capacitor-nodejs.tgz",
"chokidar": "~4.0.3",
"electron-is-dev": "~2.0.0",
"electron-serve": "~3.0.0",
@@ -43,4 +44,4 @@
"capacitor",
"electron"
]
}
}
@@ -1,4 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const CapacitorNodejs = require('../../../node_modules/capacitor-nodejs/electron/dist/plugin.js');
module.exports = {
CapacitorNodejs,
}
+17 -21
View File
@@ -1,12 +1,12 @@
{
"name": "materialious",
"version": "1.11.6",
"version": "1.11.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "materialious",
"version": "1.11.6",
"version": "1.11.7",
"hasInstallScript": true,
"dependencies": {
"@capacitor-community/electron": "^5.0.1",
@@ -95,7 +95,6 @@
"integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.27.1",
"@babel/generator": "^7.28.3",
@@ -2069,7 +2068,6 @@
"resolved": "https://registry.npmjs.org/@capacitor/core/-/core-7.4.3.tgz",
"integrity": "sha512-wCWr8fQ9Wxn0466vPg7nMn0tivbNVjNy1yL4GvDSIZuZx7UpU2HeVGNe9QjN/quEd+YLRFeKEBLBw619VqUiNg==",
"license": "MIT",
"peer": true,
"dependencies": {
"tslib": "^2.1.0"
}
@@ -3346,7 +3344,6 @@
"integrity": "sha512-7TSvMrCdmig5TMyYDW876C5FljhA0wlGixtvASCiqUqtLfmyEEpaysXjC7GhR5mWcGRrCGF+L2Bl1eEaW1wTCA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@standard-schema/spec": "^1.0.0",
"@sveltejs/acorn-typescript": "^1.0.5",
@@ -3386,7 +3383,6 @@
"integrity": "sha512-YZs/OSKOQAQCnJvM/P+F1URotNnYNeU3P2s4oIpzm1uFaqUEqRxUB0g5ejMjEb5Gjb9/PiBI5Ktrq4rUUF8UVQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@sveltejs/vite-plugin-svelte-inspector": "^5.0.0",
"debug": "^4.4.1",
@@ -3637,7 +3633,6 @@
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.3.tgz",
"integrity": "sha512-lX7HFZeHf4QG/J7tBZqrCAXwz9J5RD56Y6MpP0eJkka8p+K0RY/yBTW7CYFJ4VGCclxqOLKmiGP5juQc6MKgcw==",
"license": "MIT",
"peer": true,
"dependencies": {
"undici-types": "~6.21.0"
}
@@ -3715,7 +3710,6 @@
"integrity": "sha512-6m1I5RmHBGTnUGS113G04DMu3CpSdxCAU/UvtjNWL4Nuf3MW9tQhiJqRlHzChIkhy6kZSAQmc+I1bcGjE3yNKg==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@typescript-eslint/scope-manager": "8.46.3",
"@typescript-eslint/types": "8.46.3",
@@ -3975,7 +3969,6 @@
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"license": "MIT",
"peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -4548,7 +4541,6 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.8.3",
"caniuse-lite": "^1.0.30001741",
@@ -6006,7 +5998,6 @@
"integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.1",
@@ -9613,7 +9604,6 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"nanoid": "^3.3.11",
"picocolors": "^1.1.1",
@@ -9811,7 +9801,6 @@
"integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
"dev": true,
"license": "MIT",
"peer": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
@@ -10698,7 +10687,6 @@
"integrity": "sha512-CLEVl+MnPAiKh5pl4dEWSyMTpuflgNQiLGhMv8ezD5W/qP8AKvmYpCOKRRNOh7oRKnauBZ4SyeYkMS+1VSyKwQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@types/estree": "1.0.8"
},
@@ -11632,7 +11620,6 @@
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.43.5.tgz",
"integrity": "sha512-HQoZArIewxQVNedseDsgMgnRSC4XOXczxXLF9rOJaPIJkg58INOPUiL8aEtzqZIXNSZJyw8NmqObwg/voajiHQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"@jridgewell/remapping": "^2.3.4",
"@jridgewell/sourcemap-codec": "^1.5.0",
@@ -11692,6 +11679,21 @@
}
}
},
"node_modules/svelte-check/node_modules/picomatch": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/svelte-eslint-parser": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-1.4.0.tgz",
@@ -11952,7 +11954,6 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},
@@ -12202,7 +12203,6 @@
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"devOptional": true,
"license": "Apache-2.0",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -12441,7 +12441,6 @@
"integrity": "sha512-ZWyE8YXEXqJrrSLvYgrRP7p62OziLW7xI5HYGWFzOvupfAlrLvURSzv/FyGyy0eidogEM3ujU+kUG1zuHgb6Ug==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.5.0",
@@ -13023,7 +13022,6 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},
@@ -13376,7 +13374,6 @@
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
@@ -13493,7 +13490,6 @@
"integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==",
"dev": true,
"license": "MIT",
"peer": true,
"bin": {
"rollup": "dist/bin/rollup"
},
@@ -29,7 +29,11 @@
});
</script>
<a href={resolve(`/channel/${channel.authorId}`)} class="wave" style="min-width: 100%;min-height: 100%;">
<a
href={resolve(`/channel/[authorId]`, { authorId: channel.authorId })}
class="wave"
style="min-width: 100%;min-height: 100%;"
>
<div class="padding">
{#if !$interfaceLowBandwidthMode}
<div class="center-align">
@@ -12,7 +12,7 @@
let { hashtag }: Props = $props();
</script>
<a href={resolve(hashtag.url)} class="wave" style="min-width: 100%;min-height: 100%;">
<a href={resolve(hashtag.url, {})} class="wave" style="min-width: 100%;min-height: 100%;">
<div class="padding">
<h5 class="center-align">{truncate(hashtag.title, 14)}</h5>
<h6 style="margin-top: 0;" class="center-align grey-text medium-text">
@@ -20,7 +20,7 @@
let img: HTMLImageElement | undefined = $state();
const playlistLink = `/playlist/${playlist.playlistId}`;
const playlistLink = resolve('/playlist/[playlistId]', { playlistId: playlist.playlistId });
onMount(async () => {
if (get(interfaceLowBandwidthMode)) return;
@@ -48,7 +48,7 @@
</script>
<a
href={resolve(playlistLink)}
href={playlistLink}
class:link-disabled={disabled}
style="width: 100%; overflow: hidden;min-height:100px;"
class="wave"
@@ -77,13 +77,17 @@
<div class="small-padding">
<nav class="no-margin">
<div class="max">
<a class:link-disabled={disabled} href={resolve(playlistLink)}
<a class:link-disabled={disabled} href={playlistLink}
><div class="bold">{letterCase(truncate(playlist.title))}</div></a
>
<div>
<a class:link-disabled={playlist.authorId === null} href={resolve(`/channel/${playlist.authorId}`)}
>{playlist.author}</a
>
{#if playlist.authorId}
<a href={resolve('/channel/[authorId]', { authorId: playlist.authorId })}
>{playlist.author}</a
>
{:else}
<p>{playlist.author}</p>
{/if}
</div>
</div>
</nav>
@@ -52,7 +52,7 @@
}
selectedSuggestionIndex = -1;
goto(resolve(`/search/${encodeURIComponent(searchTrimed)}`));
goto(resolve(`/search/[search]`, { search: encodeURIComponent(searchTrimed) }));
suggestionsForSearch = [];
showSearchBox = false;
@@ -156,7 +156,7 @@
<i class="front" role="presentation" onclick={resetSearch}>close</i>
</div>
{#if searchSuggestions}
{#each suggestionsForSearch as suggestion, index}
{#each suggestionsForSearch as suggestion, index (index)}
<li>
<a
onclick={() => {
@@ -164,7 +164,7 @@
handleSubmit();
}}
class:selected={index === selectedSuggestionIndex}
href={resolve(`/search/${encodeURIComponent(suggestion)}`)}
href={resolve(`/search/[search]`, { search: encodeURIComponent(suggestion) })}
>
<div>{suggestion}</div>
</a>
@@ -172,13 +172,13 @@
{/each}
{/if}
{#if !suggestionsForSearch.length && $interfaceSearchHistoryEnabled}
{#each $searchHistoryStore as history}
{#each $searchHistoryStore as history (history)}
<li>
<a
onclick={() => {
search = history;
}}
href={resolve(`/search/${encodeURIComponent(history)}`)}
href={resolve(`/search/[search]`, { search: encodeURIComponent(history) })}
>
<div>{history}</div>
</a>
@@ -34,7 +34,7 @@
if (Capacitor.isNativePlatform()) {
url = `${get(instanceStore)}/watch/${video.videoId}`;
} else {
url = `${location.origin}`+resolve(`/watch/${video.videoId}`);
url = `${location.origin}${resolve('/watch/[videoId]', { videoId: video.videoId })}`;
}
if (includeTimestamp && currentTime !== undefined) {
url += `?time=${Math.floor(currentTime)}`;
@@ -21,7 +21,7 @@
events.events.forEach((event) => {
if (event.type === 'change-video' && event.videoId) {
currentUrl.pathname = resolve(`/watch/${event.videoId}`);
currentUrl.pathname = resolve(`/watch/[videoId]`, { videoId: event.videoId });
goto(currentUrl);
} else if (event.type === 'goto' && event.path && event.path !== $page.url.pathname) {
if (blockedPages.includes(event.path.replace('/', ''))) {
@@ -73,7 +73,7 @@
}
page.subscribe((newPage) => {
if (!newPage.url.pathname.startsWith(resolve('/watch')) && $syncPartyPeerStore) {
if (!newPage.url.pathname.startsWith(resolve('/watch', {})) && $syncPartyPeerStore) {
$syncPartyConnectionsStore?.forEach((conn) => {
conn.send({
events: [
@@ -125,7 +125,7 @@
<input
name="sync-share"
readonly
value={`${location.origin}`+resolve(`/?sync=${$syncPartyPeerStore.id}`)}
value={`${location.origin}${resolve(`/?sync=${$syncPartyPeerStore?.id}`, {})}`}
type="text"
/>
<label class="active" for="sync-share">Share URL</label>
@@ -133,7 +133,7 @@
<button
onclick={async () => {
await Clipboard.write({
string: `${location.origin}`+resolve(`/?sync=${$syncPartyPeerStore?.id}`)
string: `${location.origin}${resolve(`/?sync=${$syncPartyPeerStore?.id}`, {})}`
});
}}
class="square round"
@@ -213,7 +213,10 @@
</a>
<div>
<a tabindex="-1" class:author={!sideways} href={resolve(`/channel/${video.authorId}`)}
<a
tabindex="-1"
class:author={!sideways}
href={resolve(`/channel/[authorId]`, { authorId: video.authorId })}
>{video.author}
</a>
@@ -90,7 +90,7 @@
instanceStore.set(instance);
authStore.set(null);
goto(resolve('/'), { replaceState: true });
goto(resolve('/', {}), { replaceState: true });
ui('#dialog-settings');
}
@@ -25,7 +25,7 @@
</script>
<nav>
<a href={resolve(`/channel/${video.authorId}`)}>
<a href={resolve(`/channel/[authorId]`, { authorId: video.authorId })}>
<nav style="gap: 0.5em;">
{#if !$interfaceLowBandwidthMode}
<img
@@ -35,7 +35,7 @@
function commentTimestamps(html: string): string {
const regex =
/<a href="([^"]+)" data-onclick="jump_to_time" data-jump-time="(\d+)">([^<]+)<\/a>\s*(.+)/g;
const replacement = `<a href=${resolve(`/watch/${videoId}?time=$2`)} data-sveltekit-preload-data="off" class="link">$3 $4</a>`;
const replacement = `<a href=${resolve(`/watch/[videoId]?time=$2`, { videoId: videoId })} data-sveltekit-preload-data="off" class="link">$3 $4</a>`;
const processedHtml = html.replace(regex, replacement);
@@ -64,7 +64,7 @@
<progress class="circle"></progress>
{/if}
<div class="comment-info">
<a href={resolve(`/channel/${comment.authorId}`)} class="author">
<a href={resolve(`/channel/[authorId]`, { authorId: comment.authorId })} class="author">
<span class="bold" class:channel-owner={comment.authorIsChannelOwner}>
{comment.author}
</span>
@@ -34,8 +34,11 @@
{#if video.keywords && video.keywords.length > 0}
<article class="border">
<nav class="scroll">
{#each video.keywords as keyword}
<a href={resolve(`/search/${encodeURIComponent(keyword)}`)} class="chip">{keyword}</a>
{#each video.keywords as keyword (keyword)}
<a
href={resolve(`/search/[search]`, { search: encodeURIComponent(keyword) })}
class="chip">{keyword}</a
>
{/each}
</nav>
</article>
+3 -1
View File
@@ -129,7 +129,9 @@ export function expandSummery(id: string) {
}
export function createVideoUrl(videoId: string, playlistId: string): URL {
const watchPath = resolve(`/${get(isAndroidTvStore) ? 'tv' : 'watch'}/${videoId}`);
const watchPath = resolve(`/${get(isAndroidTvStore) ? 'tv' : 'watch'}/[videoId]`, {
videoId: videoId
});
const watchUrl = new URL(`${location.origin}${watchPath}`);
if (playlistId !== '') {
+16 -6
View File
@@ -44,9 +44,14 @@ export async function goToNextVideo(video: VideoPlay, playlistId: string | null)
if (!playlistId) {
if (get(playerAutoplayNextByDefaultStore)) {
goto(resolve(`/${isAndroidTv ? 'tv' : 'watch'}/${video.recommendedVideos[0].videoId}`), {
replaceState: isAndroidTv
});
goto(
resolve(`/${isAndroidTv ? 'tv' : 'watch'}/[videoId]`, {
videoId: video.recommendedVideos[0].videoId
}),
{
replaceState: isAndroidTv
}
);
}
return;
}
@@ -86,8 +91,13 @@ export async function goToNextVideo(video: VideoPlay, playlistId: string | null)
} as PlayerEvents);
});
goto(resolve(`/${isAndroidTv ? 'tv' : 'watch'}/${goToVideo.videoId}?playlist=${playlistId}`), {
replaceState: isAndroidTv
});
goto(
resolve(`/${isAndroidTv ? 'tv' : 'watch'}/[videoId]?playlist=${playlistId}`, {
videoId: goToVideo.videoId
}),
{
replaceState: isAndroidTv
}
);
}
}
+13 -9
View File
@@ -103,7 +103,7 @@
return;
}
goto(resolve(`/watch/${videoId}`));
goto(resolve(`/watch/[videoId]`, { videoId: videoId }));
} else {
// Auth response handling for Mobile
const username = url.searchParams.get('username');
@@ -129,7 +129,7 @@
path.search = searchParams.toString();
await Browser.open({ url: path.toString() });
} else {
searchParams.set('callback_url', `${location.origin}`+resolve('/auth'));
searchParams.set('callback_url', `${location.origin}${resolve('/auth', {})}`);
path.search = searchParams.toString();
document.location.href = path.toString();
}
@@ -174,7 +174,7 @@
console.log(sid);
authStore.set({ username: rawUsername, token: sid });
await ui('#tv-login');
goto(resolve('/'), { replaceState: true });
goto(resolve('/', {}), { replaceState: true });
return;
}
}
@@ -188,7 +188,7 @@
feedCacheStore.set({});
searchCacheStore.set({});
playlistCacheStore.set({});
goto(resolve('/'));
goto(resolve('/', {}));
}
async function loadNotifications() {
@@ -278,7 +278,7 @@
<nav class="left m l surface-container" class:tv-nav={$isAndroidTvStore}>
<header
role="presentation"
onclick={() => goto(resolve($interfaceDefaultPage))}
onclick={() => goto(resolve($interfaceDefaultPage, {}))}
style="cursor: pointer;"
tabindex="-1"
class="small-padding"
@@ -287,7 +287,7 @@
</header>
{#each getPages() as navPage}
{#if !navPage.requiresAuth || isLoggedIn}
<a href={resolve(navPage.href)} class:active={$page.url.href.endsWith(navPage.href)}
<a href={resolve(navPage.href, {})} class:active={$page.url.href.endsWith(navPage.href)}
><i>{navPage.icon}</i>
<div>{navPage.name}</div>
</a>
@@ -366,7 +366,7 @@
{#if !navPage.requiresAuth || isLoggedIn}
<a
class="round"
href={resolve(navPage.href)}
href={resolve(navPage.href, {})}
class:active={$page.url.href.endsWith(navPage.href)}
data-sveltekit-preload-data="off"
><i>{navPage.icon}</i>
@@ -422,7 +422,9 @@
</div>
{#if playerIsPip}
<nav class="s">
<a class="button border" href={resolve(`/watch/${$playerState.data.video.videoId}`)}
<a
class="button border"
href={resolve(`/watch/[videoId]`, { videoId: $playerState.data.video.videoId })}
><i>keyboard_arrow_right</i></a
>
<button class="border" onclick={() => playerState.set(undefined)}>
@@ -433,7 +435,9 @@
<nav class="m l">
<Author video={$playerState.data.video} hideSubscribe={true} />
<div class="max"></div>
<a class="button border" href={resolve(`/watch/${$playerState.data.video.videoId}`)}
<a
class="button border"
href={resolve(`/watch/[videoId]`, { videoId: $playerState.data.video.videoId })}
><i>keyboard_arrow_right</i></a
>
</nav>
@@ -18,7 +18,7 @@
});
}
goto(resolve('/'));
goto(resolve('/', {}));
});
</script>
@@ -224,7 +224,7 @@
<div class="grid">
<div class="s12 m6 l6">
<nav class="group">
{#each sortByOptions as sortingOption}
{#each sortByOptions as sortingOption (sortingOption)}
<button
class="no-round"
onclick={async () => {
@@ -5,7 +5,7 @@ import { error } from '@sveltejs/kit';
export async function load({ url }) {
const playlistId = url.searchParams.get('list');
if (playlistId) {
goto(resolve(`/playlist/${playlistId}`));
goto(resolve(`/playlist/[playlistId]`, { playlistId }));
} else {
error(404);
}
@@ -15,9 +15,14 @@
{#if data.playlist.videos}
<nav>
<a
href={!$isAndroidTvStore
? resolve(`/watch/${data.playlist.videos[0].videoId}?playlist=${data.playlist.info.playlistId}`)
: resolve(`/tv/${data.playlist.videos[0].videoId}?playlist=${data.playlist.info.playlistId}`)}
href={resolve(
$isAndroidTvStore
? `/tv/[playlistId]?playlist=${data.playlist.info.playlistId}`
: `/watch/[playlistId]?playlist=${data.playlist.info.playlistId}`,
{
playlistId: data.playlist.videos[0].videoId
}
)}
class="button circle extra no-margin"
>
<i>play_arrow</i>
@@ -27,9 +32,14 @@
</a>
<a
href={!$isAndroidTvStore
? resolve(`/watch/${unsafeRandomItem(data.playlist.videos).videoId}?playlist=${data.playlist.info.playlistId}`)
: resolve(`/tv/${unsafeRandomItem(data.playlist.videos).videoId}?playlist=${data.playlist.info.playlistId}`)}
href={resolve(
$isAndroidTvStore
? `/tv/[playlistId]?playlist=${data.playlist.info.playlistId}`
: `/watch/[playlistId]?playlist=${data.playlist.info.playlistId}`,
{
playlistId: unsafeRandomItem(data.playlist.videos).videoId
}
)}
onclick={() =>
playlistSettingsStore.set({
[data.playlist.info.playlistId]: { shuffle: true, loop: false }
@@ -37,7 +37,7 @@
<div class="page right active">
<div class="space"></div>
<div class="grid">
{#each playlists.playlists as playlist}
{#each playlists.playlists as playlist (playlist.playlistId)}
<ContentColumn>
<article class="no-padding" style="height: 100%;">
{#key playlist.playlistId}
@@ -43,10 +43,10 @@
/>
</div>
{#each subscriptions as sub}
{#each subscriptions as sub (sub.authorId)}
<article>
<nav>
<a href={resolve(`/channel/${sub.authorId}`)}
<a href={resolve(`/channel/[authorId]`, { authorId: sub.authorId })}
><h6>
{sub.author}
</h6></a
+1 -1
View File
@@ -8,7 +8,7 @@ export async function load({ url }) {
const timestamp = url.searchParams.get('t');
if (videoId) {
let goToUrl = new URL(`${location.origin}`+resolve(`/watch/${videoId}`));
const goToUrl = new URL(`${location.origin}${resolve(`/watch/[videoId]`, { videoId })}`);
if (playlistId) {
goToUrl.searchParams.set('playlist', playlistId);
@@ -454,7 +454,7 @@
<i>add</i>
<div class="tooltip">{$_('player.addToPlaylist')}</div>
<menu class="no-wrap mobile">
{#each personalPlaylists as personalPlaylist}
{#each personalPlaylists as personalPlaylist (personalPlaylist.playlistId)}
<li
role="presentation"
class="row"
@@ -510,7 +510,7 @@
<div class="space"></div>
<div class="chapter-list" id="chapters">
<ul class="list">
{#each data.content.timestamps as timestamp}
{#each data.content.timestamps as timestamp (timestamp)}
<li
role="presentation"
onclick={() => {
@@ -551,7 +551,7 @@
<div class="space"></div>
<div class="medium scroll">
{#each comments.comments as comment}
{#each comments.comments as comment (comment)}
<Comment {comment} videoId={data.video.videoId}></Comment>
{/each}
{#if comments.continuation}
@@ -581,8 +581,10 @@
{$_('videos')}
</p>
<p>
<a href={resolve(`/channel/${$playlistCacheStore[data.playlistId].info.authorId}`)}
>{$playlistCacheStore[data.playlistId].info.author}</a
<a
href={resolve(`/channel/[authorId]`, {
authorId: $playlistCacheStore[data.playlistId].info.authorId
})}>{$playlistCacheStore[data.playlistId].info.author}</a
>
</p>
<nav>
@@ -639,7 +641,7 @@
<div class="space"></div>
{#each $playlistCacheStore[data.playlistId].videos as playlistVideo}
{#each $playlistCacheStore[data.playlistId].videos as playlistVideo (playlistVideo.videoId)}
<article
class="no-padding border"
style="margin: .7em;"
@@ -657,7 +659,7 @@
{/each}
</article>
{:else if data.video.recommendedVideos}
{#each data.video.recommendedVideos as recommendedVideo}
{#each data.video.recommendedVideos as recommendedVideo (recommendedVideo.videoId)}
<article class="no-padding border">
{#key recommendedVideo.videoId}
<Thumbnail video={recommendedVideo} sideways={true} />
+4 -4
View File
@@ -18,14 +18,14 @@ export async function load({ url }) {
isAndroidTvStore.set((await androidTv.isAndroidTv()).value);
const resolvedRoot = resolve('/');
if (url.pathname.startsWith(resolvedRoot+'@')) {
const resolvedRoot = resolve('/', {});
if (url.pathname.startsWith(resolvedRoot + '@')) {
const username = url.pathname.substring(resolvedRoot.length).split('/')[0];
try {
const resolvedUrl = await getResolveUrl(`www.youtube.com/${username}`);
if (resolvedUrl.pageType === 'WEB_PAGE_TYPE_CHANNEL') {
goto(resolve(`/channel/${resolvedUrl.ucid}`));
goto(resolve(`/channel/[authorId]`, { authorId: resolvedUrl.ucid }));
}
} catch {}
}
@@ -41,7 +41,7 @@ export async function load({ url }) {
) {
getPages().forEach((page) => {
if (page.href === defaultPage && (!page.requiresAuth || get(authStore))) {
goto(resolve(defaultPage));
goto(resolve(defaultPage, {}));
}
});
}