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:
+27
-22
@@ -33,7 +33,9 @@ function createSessionsStore() {
|
||||
const sessions = event.payload.sessions as unknown as Session[];
|
||||
log.debug(`Received ${sessions.length} sessions from backend`);
|
||||
sessions.forEach((s, i) => {
|
||||
log.debug(`Session ${i}: id=${s.id}, device=${s.deviceName}, supportsRemoteControl=${s.supportsRemoteControl}`);
|
||||
log.debug(
|
||||
`Session ${i}: id=${s.id}, device=${s.deviceName}, supportsRemoteControl=${s.supportsRemoteControl}`,
|
||||
);
|
||||
});
|
||||
update((s) => ({
|
||||
...s,
|
||||
@@ -55,7 +57,9 @@ function createSessionsStore() {
|
||||
|
||||
log.debug(`Manual refresh returned ${sessions.length} sessions`);
|
||||
sessions.forEach((s, i) => {
|
||||
log.debug(`Session ${i}: id=${s.id}, device=${s.deviceName}, supportsRemoteControl=${s.supportsRemoteControl}`);
|
||||
log.debug(
|
||||
`Session ${i}: id=${s.id}, device=${s.deviceName}, supportsRemoteControl=${s.supportsRemoteControl}`,
|
||||
);
|
||||
});
|
||||
|
||||
update((s) => ({
|
||||
@@ -76,7 +80,6 @@ function createSessionsStore() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Select a session for control
|
||||
*/
|
||||
@@ -140,7 +143,10 @@ function createSessionsStore() {
|
||||
/**
|
||||
* Seek to position (in ticks)
|
||||
*/
|
||||
async function sendSeek(sessionId: string | null | undefined, positionTicks: number): Promise<void> {
|
||||
async function sendSeek(
|
||||
sessionId: string | null | undefined,
|
||||
positionTicks: number,
|
||||
): Promise<void> {
|
||||
try {
|
||||
await commands.remoteSessionSeek(sessionId ?? "", positionTicks);
|
||||
// Don't refresh immediately for seek to avoid UI lag
|
||||
@@ -182,7 +188,7 @@ function createSessionsStore() {
|
||||
async function playOnSession(
|
||||
sessionId: string | null | undefined,
|
||||
itemIds: string[],
|
||||
startIndex = 0
|
||||
startIndex = 0,
|
||||
): Promise<void> {
|
||||
log.debug("========== playOnSession called ==========");
|
||||
log.debug("sessionId:", sessionId);
|
||||
@@ -224,9 +230,8 @@ export const sessions = createSessionsStore();
|
||||
/**
|
||||
* Sessions that are currently playing media
|
||||
*/
|
||||
export const activeSessions = derived(
|
||||
sessions,
|
||||
($sessions) => $sessions.sessions.filter((s) => s.nowPlayingItem !== null)
|
||||
export const activeSessions = derived(sessions, ($sessions) =>
|
||||
$sessions.sessions.filter((s) => s.nowPlayingItem !== null),
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -234,22 +239,22 @@ export const activeSessions = derived(
|
||||
*/
|
||||
export const selectedSession = derived(
|
||||
sessions,
|
||||
($sessions) =>
|
||||
$sessions.sessions.find((s) => s.id === $sessions.selectedSessionId) ?? null
|
||||
($sessions) => $sessions.sessions.find((s) => s.id === $sessions.selectedSessionId) ?? null,
|
||||
);
|
||||
|
||||
/**
|
||||
* Controllable sessions (support remote control)
|
||||
*/
|
||||
export const controllableSessions = derived(
|
||||
sessions,
|
||||
($sessions) => {
|
||||
const controllable = $sessions.sessions.filter((s) => s.supportsRemoteControl);
|
||||
log.debug(`Filtering ${$sessions.sessions.length} total sessions, ${controllable.length} are controllable`);
|
||||
$sessions.sessions.forEach((s, i) => {
|
||||
const status = s.supportsRemoteControl ? "✓ CONTROLLABLE" : "✗ NOT CONTROLLABLE";
|
||||
log.debug(` ${status}: ${s.deviceName} (id=${s.id}, supportsRemoteControl=${s.supportsRemoteControl})`);
|
||||
});
|
||||
return controllable;
|
||||
}
|
||||
);
|
||||
export const controllableSessions = derived(sessions, ($sessions) => {
|
||||
const controllable = $sessions.sessions.filter((s) => s.supportsRemoteControl);
|
||||
log.debug(
|
||||
`Filtering ${$sessions.sessions.length} total sessions, ${controllable.length} are controllable`,
|
||||
);
|
||||
$sessions.sessions.forEach((s, i) => {
|
||||
const status = s.supportsRemoteControl ? "✓ CONTROLLABLE" : "✗ NOT CONTROLLABLE";
|
||||
log.debug(
|
||||
` ${status}: ${s.deviceName} (id=${s.id}, supportsRemoteControl=${s.supportsRemoteControl})`,
|
||||
);
|
||||
});
|
||||
return controllable;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user