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
+11 -29
View File
@@ -52,34 +52,22 @@ describe("image cache service", () => {
describe("getCachedImageUrl", () => {
it("should build server URL with default image type", async () => {
const url = await getCachedImageUrl(
"http://server.local:8096",
"item-123"
);
const url = await getCachedImageUrl("http://server.local:8096", "item-123");
expect(url).toContain("http://server.local:8096/Items/item-123/Images/Primary");
});
it("should build server URL with custom image type", async () => {
const url = await getCachedImageUrl(
"http://server.local:8096",
"item-123",
"Backdrop"
);
const url = await getCachedImageUrl("http://server.local:8096", "item-123", "Backdrop");
expect(url).toContain("Backdrop");
});
it("should include image options in URL", async () => {
const url = await getCachedImageUrl(
"http://server.local:8096",
"item-123",
"Primary",
{
maxWidth: 300,
maxHeight: 400,
quality: 90,
tag: "abc123",
}
);
const url = await getCachedImageUrl("http://server.local:8096", "item-123", "Primary", {
maxWidth: 300,
maxHeight: 400,
quality: 90,
tag: "abc123",
});
expect(url).toContain("maxWidth=300");
expect(url).toContain("maxHeight=400");
expect(url).toContain("quality=90");
@@ -92,9 +80,7 @@ describe("image cache service", () => {
await getCachedImageUrl("http://server.local:8096", "item-123");
const saveCall = invokeSpy.mock.calls.find(
(call) => call[0] === "thumbnail_save"
);
const saveCall = invokeSpy.mock.calls.find((call) => call[0] === "thumbnail_save");
expect(saveCall).toBeDefined();
expect(saveCall![1]).toHaveProperty("itemId", "item-123");
expect(saveCall![1]).toHaveProperty("imageType", "Primary");
@@ -117,9 +103,7 @@ describe("image cache service", () => {
const { invoke } = await import("@tauri-apps/api/core");
const invokeSpy = vi.mocked(invoke);
const setLimitCall = invokeSpy.mock.calls.find(
(call) => call[0] === "thumbnail_set_limit"
);
const setLimitCall = invokeSpy.mock.calls.find((call) => call[0] === "thumbnail_set_limit");
expect(setLimitCall).toBeDefined();
expect(setLimitCall![1]).toHaveProperty("limitBytes", limit);
});
@@ -139,9 +123,7 @@ describe("image cache service", () => {
const { invoke } = await import("@tauri-apps/api/core");
const invokeSpy = vi.mocked(invoke);
const deleteCall = invokeSpy.mock.calls.find(
(call) => call[0] === "thumbnail_delete_item"
);
const deleteCall = invokeSpy.mock.calls.find((call) => call[0] === "thumbnail_delete_item");
expect(deleteCall).toBeDefined();
expect(deleteCall![1]).toHaveProperty("itemId", "item-456");
});