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:
+12
-15
@@ -5,10 +5,7 @@ import { writable, derived } from "svelte/store";
|
||||
import type { MediaItem } from "$lib/api/types";
|
||||
import { auth } from "./auth";
|
||||
import { buildHeroMix } from "$lib/utils/heroMix";
|
||||
import {
|
||||
filterSupersededResumeItems,
|
||||
filterInProgressNextUpItems,
|
||||
} from "./continueWatchingFilter";
|
||||
import { filterSupersededResumeItems, filterInProgressNextUpItems } from "./continueWatchingFilter";
|
||||
import { createLogger } from "$lib/utils/logger";
|
||||
|
||||
const log = createLogger("TvStore");
|
||||
@@ -60,7 +57,7 @@ function createTvStore() {
|
||||
!!i.imageId;
|
||||
|
||||
async function loadSections(libraryId: string) {
|
||||
update(s => ({
|
||||
update((s) => ({
|
||||
...s,
|
||||
isLoading: s.continueWatching.length === 0 && s.recentlyAdded.length === 0,
|
||||
error: null,
|
||||
@@ -82,7 +79,7 @@ function createTvStore() {
|
||||
recursive: true,
|
||||
limit: SECTION_LIMIT,
|
||||
})
|
||||
.then(r => r.items)
|
||||
.then((r) => r.items)
|
||||
.catch(() => [] as MediaItem[]),
|
||||
]);
|
||||
|
||||
@@ -91,8 +88,8 @@ function createTvStore() {
|
||||
// Then drop episodes the user has moved past — a stale partial position
|
||||
// behind the series' Next Up entry isn't something to continue.
|
||||
const continueWatching = filterSupersededResumeItems(
|
||||
resume.filter(i => i.kind === "episode" || i.kind === "movie"),
|
||||
rawNextUp
|
||||
resume.filter((i) => i.kind === "episode" || i.kind === "movie"),
|
||||
rawNextUp,
|
||||
);
|
||||
// And drop from Next Up the episodes that are already under way — those
|
||||
// are Continue Watching's, or the two rows show the same cards.
|
||||
@@ -102,7 +99,7 @@ function createTvStore() {
|
||||
// recent additions, and random series from across the library.
|
||||
const heroItems = buildHeroMix([continueWatching, nextUp, latest, surprise], hasArt);
|
||||
|
||||
update(s => ({
|
||||
update((s) => ({
|
||||
...s,
|
||||
continueWatching,
|
||||
nextUp,
|
||||
@@ -116,7 +113,7 @@ function createTvStore() {
|
||||
loadGenreRows(libraryId);
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : "Failed to load TV sections";
|
||||
update(s => ({ ...s, isLoading: false, error: message }));
|
||||
update((s) => ({ ...s, isLoading: false, error: message }));
|
||||
log.error("Failed to load TV sections:", error);
|
||||
}
|
||||
}
|
||||
@@ -149,15 +146,15 @@ function createTvStore() {
|
||||
log.warn(`Failed to load genre row "${genre.name}":`, e);
|
||||
return { id: genre.id, name: genre.name, items: [] };
|
||||
}
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const genreRows = rows
|
||||
.filter(row => row.items.length > 0)
|
||||
.filter((row) => row.items.length > 0)
|
||||
.sort((a, b) => b.items.length - a.items.length)
|
||||
.slice(0, MAX_GENRE_ROWS);
|
||||
|
||||
update(s => ({ ...s, genreRows }));
|
||||
update((s) => ({ ...s, genreRows }));
|
||||
} catch (e) {
|
||||
log.warn("Failed to load TV genre rows:", e);
|
||||
}
|
||||
@@ -176,5 +173,5 @@ function createTvStore() {
|
||||
|
||||
export const tv = createTvStore();
|
||||
|
||||
export const tvHeroItems = derived(tv, $t => $t.heroItems);
|
||||
export const isTvLoading = derived(tv, $t => $t.isLoading);
|
||||
export const tvHeroItems = derived(tv, ($t) => $t.heroItems);
|
||||
export const isTvLoading = derived(tv, ($t) => $t.isLoading);
|
||||
|
||||
Reference in New Issue
Block a user