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:
2026-08-21 17:41:44 +02:00
parent d095e1f410
commit ad48d89dfe
199 changed files with 4698 additions and 3453 deletions
+21 -18
View File
@@ -3,10 +3,7 @@
import { writable, derived } from "svelte/store";
import type { MediaItem } from "$lib/api/types";
import { auth } from "./auth";
import {
filterSupersededResumeItems,
filterInProgressNextUpItems,
} from "./continueWatchingFilter";
import { filterSupersededResumeItems, filterInProgressNextUpItems } from "./continueWatchingFilter";
import { createLogger } from "$lib/utils/logger";
const log = createLogger("HomeStore");
@@ -45,7 +42,11 @@ function createHomeStore() {
async function loadHomeSections() {
// Only show loading spinner when no data is available yet
update(s => ({ ...s, isLoading: s.heroItems.length === 0 && s.latestItems.length === 0, error: null }));
update((s) => ({
...s,
isLoading: s.heroItems.length === 0 && s.latestItems.length === 0,
error: null,
}));
try {
const repo = auth.getRepository();
@@ -67,7 +68,9 @@ function createHomeStore() {
]);
const valueOr = <T>(i: number, fallback: T): T =>
settled[i].status === "fulfilled" ? (settled[i] as PromiseFulfilledResult<T>).value : fallback;
settled[i].status === "fulfilled"
? (settled[i] as PromiseFulfilledResult<T>).value
: fallback;
const rawResume = valueOr(0, [] as typeof initialState.resumeItems);
const rawNextUp = valueOr(1, [] as typeof initialState.nextUpItems);
@@ -90,7 +93,7 @@ function createHomeStore() {
// Use resume items or latest as hero items
const hero = resume.length >= 3 ? resume.slice(0, 5) : latest.slice(0, 5);
update(s => ({
update((s) => ({
...s,
heroItems: hero,
resumeItems: resume,
@@ -105,7 +108,7 @@ function createHomeStore() {
}));
} catch (error) {
const message = error instanceof Error ? error.message : "Failed to load home sections";
update(s => ({ ...s, isLoading: false, error: message }));
update((s) => ({ ...s, isLoading: false, error: message }));
log.error("Failed to load home sections:", error);
}
}
@@ -124,13 +127,13 @@ function createHomeStore() {
export const home = createHomeStore();
// Derived stores for convenience
export const heroItems = derived(home, $home => $home.heroItems);
export const resumeItems = derived(home, $home => $home.resumeItems);
export const nextUpItems = derived(home, $home => $home.nextUpItems);
export const latestItems = derived(home, $home => $home.latestItems);
export const recentlyPlayedAudio = derived(home, $home => $home.recentlyPlayedAudio);
export const resumeMovies = derived(home, $home => $home.resumeMovies);
export const favoriteMovies = derived(home, $home => $home.favoriteMovies);
export const favoriteShows = derived(home, $home => $home.favoriteShows);
export const favoriteMusic = derived(home, $home => $home.favoriteMusic);
export const isHomeLoading = derived(home, $home => $home.isLoading);
export const heroItems = derived(home, ($home) => $home.heroItems);
export const resumeItems = derived(home, ($home) => $home.resumeItems);
export const nextUpItems = derived(home, ($home) => $home.nextUpItems);
export const latestItems = derived(home, ($home) => $home.latestItems);
export const recentlyPlayedAudio = derived(home, ($home) => $home.recentlyPlayedAudio);
export const resumeMovies = derived(home, ($home) => $home.resumeMovies);
export const favoriteMovies = derived(home, ($home) => $home.favoriteMovies);
export const favoriteShows = derived(home, ($home) => $home.favoriteShows);
export const favoriteMusic = derived(home, ($home) => $home.favoriteMusic);
export const isHomeLoading = derived(home, ($home) => $home.isLoading);