chore(format): run prettier over src/ and scripts/
Formatting was configured but never enforced: `bun run format:check` reported 199 unformatted files and ran in no workflow and in no git hook, so .prettierrc (printWidth 100, trailing commas) described an intention rather than the tree. This is the one-time sweep that makes the check gateable. Whitespace and token-reflow only -- no behavioural change: `bun run check` reports 0 errors and all 1053 frontend tests pass before and after. Kept out of every other commit on purpose. A 199-file diff mixed with real changes is unreviewable, and the next commit turns format:check into a hard CI gate so this cannot silently accumulate again.
This commit is contained in:
@@ -53,13 +53,21 @@
|
||||
// Compute best backdrop source (no fetch, pure derivation)
|
||||
const backdropSource = $derived.by(() => {
|
||||
if (episode.backdropImageTags?.[0]) {
|
||||
return { itemId: episode.id, imageType: "Backdrop" as const, tag: episode.backdropImageTags[0] };
|
||||
return {
|
||||
itemId: episode.id,
|
||||
imageType: "Backdrop" as const,
|
||||
tag: episode.backdropImageTags[0],
|
||||
};
|
||||
}
|
||||
if (episode.imageId) {
|
||||
return { itemId: episode.id, imageType: "Primary" as const, tag: episode.imageId };
|
||||
}
|
||||
if (series?.backdropImageTags?.[0]) {
|
||||
return { itemId: series.id, imageType: "Backdrop" as const, tag: series.backdropImageTags[0] };
|
||||
return {
|
||||
itemId: series.id,
|
||||
imageType: "Backdrop" as const,
|
||||
tag: series.backdropImageTags[0],
|
||||
};
|
||||
}
|
||||
return null;
|
||||
});
|
||||
@@ -67,8 +75,8 @@
|
||||
// Cast and genres are the episode's own when the server sent them, else the
|
||||
// series' — a list-level episode fetch often carries neither, and an empty
|
||||
// Cast row on an episode of a show with a known cast reads as broken.
|
||||
const people = $derived(episode.people?.length ? episode.people : series?.people ?? []);
|
||||
const genres = $derived(episode.genres?.length ? episode.genres : series?.genres ?? []);
|
||||
const people = $derived(episode.people?.length ? episode.people : (series?.people ?? []));
|
||||
const genres = $derived(episode.genres?.length ? episode.genres : (series?.genres ?? []));
|
||||
|
||||
// "More Like This" on an episode means similar *shows* (UR-048), so it keys
|
||||
// off the series rather than the episode.
|
||||
@@ -77,7 +85,7 @@
|
||||
const seasonHref = $derived(
|
||||
series && episode.parentIndexNumber != null
|
||||
? `/library/${series.id}#${seasonAnchorId(episode.parentIndexNumber)}`
|
||||
: null
|
||||
: null,
|
||||
);
|
||||
|
||||
function formatDuration(ms?: number | null): string {
|
||||
@@ -108,9 +116,7 @@
|
||||
goto(`/library/${series.id}?episode=${ep.id}`);
|
||||
}
|
||||
|
||||
const episodeLabel = $derived(
|
||||
`S${episode.parentIndexNumber || 1}E${episode.indexNumber || 1}`
|
||||
);
|
||||
const episodeLabel = $derived(`S${episode.parentIndexNumber || 1}E${episode.indexNumber || 1}`);
|
||||
const duration = $derived(formatDuration(episode.durationMs));
|
||||
const progress = $derived(getProgress(episode));
|
||||
</script>
|
||||
@@ -128,12 +134,16 @@
|
||||
class="absolute inset-0 w-full h-full object-cover"
|
||||
/>
|
||||
{:else}
|
||||
<div class="absolute inset-0 bg-gradient-to-br from-[var(--color-jellyfin)] to-purple-900"></div>
|
||||
<div
|
||||
class="absolute inset-0 bg-gradient-to-br from-[var(--color-jellyfin)] to-purple-900"
|
||||
></div>
|
||||
{/if}
|
||||
|
||||
<!-- Gradient overlay -->
|
||||
<div class="absolute inset-0 bg-gradient-to-r from-black/90 via-black/60 to-transparent"></div>
|
||||
<div class="absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-transparent"></div>
|
||||
<div
|
||||
class="absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-transparent"
|
||||
></div>
|
||||
|
||||
<!-- Back button -->
|
||||
{#if onBack}
|
||||
@@ -143,7 +153,12 @@
|
||||
title="Back to series"
|
||||
>
|
||||
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M15 19l-7-7 7-7"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
{/if}
|
||||
@@ -156,7 +171,10 @@
|
||||
{#if seriesName}
|
||||
<p class="text-lg">
|
||||
{#if seriesHref}
|
||||
<a href={seriesHref} class="text-gray-300 hover:text-white hover:underline transition-colors">
|
||||
<a
|
||||
href={seriesHref}
|
||||
class="text-gray-300 hover:text-white hover:underline transition-colors"
|
||||
>
|
||||
{seriesName}
|
||||
</a>
|
||||
{:else}
|
||||
@@ -192,7 +210,9 @@
|
||||
{#if episode.communityRating}
|
||||
<span class="flex items-center gap-1">
|
||||
<svg class="w-4 h-4 text-yellow-400" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
|
||||
<path
|
||||
d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
|
||||
/>
|
||||
</svg>
|
||||
{episode.communityRating.toFixed(1)}
|
||||
</span>
|
||||
@@ -200,7 +220,7 @@
|
||||
{#if episode.userData?.isPlayed}
|
||||
<span class="flex items-center gap-1 text-[var(--color-jellyfin)]">
|
||||
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
|
||||
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" />
|
||||
</svg>
|
||||
Watched
|
||||
</span>
|
||||
@@ -218,10 +238,7 @@
|
||||
{#if progress > 0 && progress < 95}
|
||||
<div class="w-64">
|
||||
<div class="h-1 bg-gray-700 rounded-full overflow-hidden">
|
||||
<div
|
||||
class="h-full bg-[var(--color-jellyfin)]"
|
||||
style="width: {progress}%"
|
||||
></div>
|
||||
<div class="h-full bg-[var(--color-jellyfin)]" style="width: {progress}%"></div>
|
||||
</div>
|
||||
<p class="text-xs text-gray-400 mt-1">
|
||||
{Math.round(progress)}% watched
|
||||
@@ -237,7 +254,7 @@
|
||||
class="px-8 py-3 bg-white text-black hover:bg-white/90 rounded-lg font-semibold text-lg flex items-center gap-2 transition-colors"
|
||||
>
|
||||
<svg class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M8 5v14l11-7z"/>
|
||||
<path d="M8 5v14l11-7z" />
|
||||
</svg>
|
||||
{progress > 0 && progress < 95 ? "Resume" : "Play"}
|
||||
</button>
|
||||
@@ -271,89 +288,106 @@
|
||||
strip — continuation content comes before discovery content
|
||||
(ux-flows §5B.2). TRACES: UR-048 | DR-061, DR-062 -->
|
||||
{#if hasEpisodeStrip}
|
||||
<div class="space-y-4">
|
||||
<h2 class="text-xl font-semibold text-white">More Episodes</h2>
|
||||
<div class="space-y-4">
|
||||
<h2 class="text-xl font-semibold text-white">More Episodes</h2>
|
||||
|
||||
<div class="flex gap-4 overflow-x-auto pb-4 scrollbar-thin scrollbar-thumb-gray-700 scrollbar-track-transparent">
|
||||
{#each adjacentEpisodes() as ep (ep.id)}
|
||||
{@const isCurrent = isCurrentEpisode(ep)}
|
||||
{@const epProgress = getProgress(ep)}
|
||||
<button
|
||||
onclick={() => !isCurrent && handleEpisodeClick(ep)}
|
||||
class="flex-shrink-0 w-64 text-left group/card {isCurrent ? 'ring-2 ring-yellow-400 rounded-lg' : ''}"
|
||||
disabled={isCurrent}
|
||||
>
|
||||
<!-- Thumbnail -->
|
||||
<div class="relative aspect-video rounded-lg overflow-hidden bg-[var(--color-surface)]">
|
||||
<CachedImage
|
||||
itemId={ep.id}
|
||||
imageType="Primary"
|
||||
tag={ep.imageId}
|
||||
maxWidth={400}
|
||||
alt={ep.name}
|
||||
class="w-full h-full object-cover transition-transform {isCurrent ? '' : 'group-hover/card:scale-105'}"
|
||||
/>
|
||||
<div
|
||||
class="flex gap-4 overflow-x-auto pb-4 scrollbar-thin scrollbar-thumb-gray-700 scrollbar-track-transparent"
|
||||
>
|
||||
{#each adjacentEpisodes() as ep (ep.id)}
|
||||
{@const isCurrent = isCurrentEpisode(ep)}
|
||||
{@const epProgress = getProgress(ep)}
|
||||
<button
|
||||
onclick={() => !isCurrent && handleEpisodeClick(ep)}
|
||||
class="flex-shrink-0 w-64 text-left group/card {isCurrent
|
||||
? 'ring-2 ring-yellow-400 rounded-lg'
|
||||
: ''}"
|
||||
disabled={isCurrent}
|
||||
>
|
||||
<!-- Thumbnail -->
|
||||
<div class="relative aspect-video rounded-lg overflow-hidden bg-[var(--color-surface)]">
|
||||
<CachedImage
|
||||
itemId={ep.id}
|
||||
imageType="Primary"
|
||||
tag={ep.imageId}
|
||||
maxWidth={400}
|
||||
alt={ep.name}
|
||||
class="w-full h-full object-cover transition-transform {isCurrent
|
||||
? ''
|
||||
: 'group-hover/card:scale-105'}"
|
||||
/>
|
||||
|
||||
<!-- Hover overlay -->
|
||||
{#if !isCurrent}
|
||||
<div class="absolute inset-0 bg-black/0 group-hover/card:bg-black/30 transition-colors flex items-center justify-center">
|
||||
<div class="opacity-0 group-hover/card:opacity-100 transition-opacity">
|
||||
<div class="w-12 h-12 rounded-full bg-[var(--color-jellyfin)] flex items-center justify-center">
|
||||
<svg class="w-6 h-6 text-white ml-1" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M8 5v14l11-7z"/>
|
||||
</svg>
|
||||
<!-- Hover overlay -->
|
||||
{#if !isCurrent}
|
||||
<div
|
||||
class="absolute inset-0 bg-black/0 group-hover/card:bg-black/30 transition-colors flex items-center justify-center"
|
||||
>
|
||||
<div class="opacity-0 group-hover/card:opacity-100 transition-opacity">
|
||||
<div
|
||||
class="w-12 h-12 rounded-full bg-[var(--color-jellyfin)] flex items-center justify-center"
|
||||
>
|
||||
<svg class="w-6 h-6 text-white ml-1" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M8 5v14l11-7z" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<!-- Now Playing indicator -->
|
||||
{#if isCurrent}
|
||||
<div class="absolute top-2 left-2 px-2 py-1 bg-yellow-400 text-black rounded text-xs font-semibold">
|
||||
Current
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Progress bar -->
|
||||
{#if epProgress > 0}
|
||||
<div class="absolute bottom-0 left-0 right-0 h-1 bg-gray-800">
|
||||
<!-- Now Playing indicator -->
|
||||
{#if isCurrent}
|
||||
<div
|
||||
class="h-full bg-[var(--color-jellyfin)]"
|
||||
style="width: {epProgress}%"
|
||||
></div>
|
||||
</div>
|
||||
{/if}
|
||||
class="absolute top-2 left-2 px-2 py-1 bg-yellow-400 text-black rounded text-xs font-semibold"
|
||||
>
|
||||
Current
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Played indicator -->
|
||||
{#if ep.userData?.isPlayed}
|
||||
<div class="absolute top-2 right-2">
|
||||
<svg class="w-5 h-5 text-[var(--color-jellyfin)]" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<!-- Progress bar -->
|
||||
{#if epProgress > 0}
|
||||
<div class="absolute bottom-0 left-0 right-0 h-1 bg-gray-800">
|
||||
<div class="h-full bg-[var(--color-jellyfin)]" style="width: {epProgress}%"></div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Episode info -->
|
||||
<div class="mt-2 space-y-1">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-[var(--color-jellyfin)] text-sm font-semibold whitespace-nowrap">
|
||||
{stripCardLabel(ep, episode)}
|
||||
</span>
|
||||
<p class="text-white font-medium truncate {isCurrent ? 'text-yellow-400' : 'group-hover/card:text-[var(--color-jellyfin)]'} transition-colors">
|
||||
{ep.name}
|
||||
</p>
|
||||
<!-- Played indicator -->
|
||||
{#if ep.userData?.isPlayed}
|
||||
<div class="absolute top-2 right-2">
|
||||
<svg
|
||||
class="w-5 h-5 text-[var(--color-jellyfin)]"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" />
|
||||
</svg>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{#if ep.overview}
|
||||
<p class="text-gray-400 text-sm line-clamp-2">
|
||||
{ep.overview}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
|
||||
<!-- Episode info -->
|
||||
<div class="mt-2 space-y-1">
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-[var(--color-jellyfin)] text-sm font-semibold whitespace-nowrap">
|
||||
{stripCardLabel(ep, episode)}
|
||||
</span>
|
||||
<p
|
||||
class="text-white font-medium truncate {isCurrent
|
||||
? 'text-yellow-400'
|
||||
: 'group-hover/card:text-[var(--color-jellyfin)]'} transition-colors"
|
||||
>
|
||||
{ep.name}
|
||||
</p>
|
||||
</div>
|
||||
{#if ep.overview}
|
||||
<p class="text-gray-400 text-sm line-clamp-2">
|
||||
{ep.overview}
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Discovery content, strictly below the episode strip (ux-flows §5B.2:
|
||||
|
||||
Reference in New Issue
Block a user