feat: add usage and download intent accounting

This commit is contained in:
Leon Tonhäuser committed 2026-08-09 22:52:27 +02:00
1 parent 846904f3db
commit 22fe6bf659
14 files changed
+3008 -2

No files matched your search

+13
View File
@@ -6,6 +6,7 @@ import { createImmichClient } from "./client";
import {
immichAlbum,
immichAlbumDetail,
immichAsset,
immichMetadataSearchResponse,
} from "../../../tests/fixtures/immich";
@@ -73,6 +74,18 @@ test("gets album details from the documented album endpoint", async () => {
await expect(client.getAlbum("album-1")).resolves.toEqual(immichAlbumDetail);
});
test("gets current asset metadata immediately before accounting", async () => {
server.use(
http.get(`${baseUrl}/api/assets/asset-1`, ({ request }) => {
expect(request.method).toBe("GET");
expect(request.headers.get("x-api-key")).toBe(apiKey);
return HttpResponse.json(immichAsset);
}),
);
await expect(client.getAsset("asset-1")).resolves.toEqual(immichAsset);
});
test("forces IMAGE and authorized album IDs in metadata search", async () => {
server.use(
http.post(`${baseUrl}/api/search/metadata`, async ({ request }) => {