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:
@@ -72,9 +72,7 @@
|
||||
// Auto-select a genre when linked with ?genre=<name> (e.g. from a genre tag)
|
||||
const requestedGenre = $page.url.searchParams.get("genre");
|
||||
if (requestedGenre) {
|
||||
const match = genres.find(
|
||||
(g) => g.name.toLowerCase() === requestedGenre.toLowerCase(),
|
||||
);
|
||||
const match = genres.find((g) => g.name.toLowerCase() === requestedGenre.toLowerCase());
|
||||
if (match) {
|
||||
await loadGenreItems(match);
|
||||
}
|
||||
@@ -157,14 +155,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
const aspectRatioClass = $derived(config.itemDisplayMode === "poster" ? "aspect-[2/3]" : "aspect-square");
|
||||
const aspectRatioClass = $derived(
|
||||
config.itemDisplayMode === "poster" ? "aspect-[2/3]" : "aspect-square",
|
||||
);
|
||||
const gridColsClass = $derived(
|
||||
config.itemDisplayMode === "poster"
|
||||
? "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5"
|
||||
: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6"
|
||||
: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6",
|
||||
);
|
||||
const searchPlaceholder = $derived(
|
||||
config.searchPlaceholder || `Search ${config.title.toLowerCase()}...`,
|
||||
);
|
||||
const noItemsMessage = $derived(
|
||||
config.noItemsMessage ||
|
||||
`No ${config.itemTypes[0]?.toLowerCase() || "items"} found in this genre`,
|
||||
);
|
||||
const searchPlaceholder = $derived(config.searchPlaceholder || `Search ${config.title.toLowerCase()}...`);
|
||||
const noItemsMessage = $derived(config.noItemsMessage || `No ${config.itemTypes[0]?.toLowerCase() || "items"} found in this genre`);
|
||||
</script>
|
||||
|
||||
<div class="space-y-6">
|
||||
@@ -188,7 +193,7 @@
|
||||
<SearchBar value={searchQuery} placeholder={searchPlaceholder} onInput={handleSearch} />
|
||||
|
||||
{#if !loading && filteredGenres.length > 0}
|
||||
<ResultsCounter count={filteredGenres.length} itemType="genre" searchQuery={searchQuery} />
|
||||
<ResultsCounter count={filteredGenres.length} itemType="genre" {searchQuery} />
|
||||
{/if}
|
||||
|
||||
<!-- Genres Grid -->
|
||||
@@ -220,7 +225,9 @@
|
||||
{@html config.genreIcon}
|
||||
</svg>
|
||||
</div>
|
||||
<p class="mt-2 text-sm font-medium text-white truncate group-hover:text-[var(--color-jellyfin)] transition-colors">
|
||||
<p
|
||||
class="mt-2 text-sm font-medium text-white truncate group-hover:text-[var(--color-jellyfin)] transition-colors"
|
||||
>
|
||||
{genre.name}
|
||||
</p>
|
||||
</button>
|
||||
@@ -244,11 +251,16 @@
|
||||
</div>
|
||||
{:else}
|
||||
<div>
|
||||
<ResultsCounter count={genreItems.length} itemType={config.itemTypes[0]?.toLowerCase() || "item"} />
|
||||
<ResultsCounter
|
||||
count={genreItems.length}
|
||||
itemType={config.itemTypes[0]?.toLowerCase() || "item"}
|
||||
/>
|
||||
<div class="grid {gridColsClass} gap-4 mt-4">
|
||||
{#each genreItems as item (item.id)}
|
||||
<button onclick={() => handleItemClick(item)} class="group text-left">
|
||||
<div class="{aspectRatioClass} bg-[var(--color-surface)] rounded-lg overflow-hidden mb-2">
|
||||
<div
|
||||
class="{aspectRatioClass} bg-[var(--color-surface)] rounded-lg overflow-hidden mb-2"
|
||||
>
|
||||
<CachedImage
|
||||
itemId={item.id}
|
||||
imageType="Primary"
|
||||
@@ -258,7 +270,9 @@
|
||||
class="w-full h-full object-cover group-hover:scale-105 transition-transform"
|
||||
/>
|
||||
</div>
|
||||
<p class="font-medium text-white truncate group-hover:text-[var(--color-jellyfin)] transition-colors">
|
||||
<p
|
||||
class="font-medium text-white truncate group-hover:text-[var(--color-jellyfin)] transition-colors"
|
||||
>
|
||||
{truncateMiddle(item.name, 40)}
|
||||
</p>
|
||||
{#if item.productionYear}
|
||||
|
||||
Reference in New Issue
Block a user