Merge v2.1-2.2.0 features onto SakaniUI base
Ports calendar, self-service, sorting, image descriptions, logo (2.1), filename search (2.1.1), statistics page, collab option and bundled invoice PDF delivery (2.2.0) onto the deployed SakaniUI portal. Also fixes the statistics daily series, which ended yesterday and so hid today's activity from the charts, and ignores Playwright test-results/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
c0c2425dda
106 files changed
+10000
-110
No files matched your search
@@ -84,7 +84,7 @@ export function createBulkDownloadHandler(dependencies: BulkDownloadHandlerDepen
|
||||
const downloads: PreparedDownload[] = [];
|
||||
try {
|
||||
for (const item of items) {
|
||||
const intent = await createIntent(dependencies, principal.editorialId, item, payload.maxPriceCents);
|
||||
const intent = await createIntent(dependencies, principal.editorialId, item, payload.maxPriceCents, payload.collab === true);
|
||||
const claim = await dependencies.repository.claimAuthorized(principal.editorialId, intent.id);
|
||||
if (claim.outcome !== "claimed") throw new UsageAccountingError("IDEMPOTENCY_CONFLICT");
|
||||
|
||||
@@ -197,6 +197,7 @@ const bulkPayload = z.strictObject({
|
||||
}),
|
||||
])).min(1).max(100),
|
||||
maxPriceCents: z.number().int().nonnegative(),
|
||||
collab: z.boolean().optional(),
|
||||
});
|
||||
|
||||
type Selection = z.output<typeof bulkPayload>["items"][number];
|
||||
@@ -232,6 +233,7 @@ async function createIntent(
|
||||
editorialId: string,
|
||||
item: Selection,
|
||||
maxPriceCents: number,
|
||||
collab: boolean,
|
||||
) {
|
||||
if ("usageId" in item) {
|
||||
const prior = await dependencies.listPriorUsages(editorialId, item.assetId);
|
||||
@@ -242,7 +244,12 @@ async function createIntent(
|
||||
}
|
||||
|
||||
await dependencies.assertOriginalAccess(editorialId, item.assetId, item.albumId);
|
||||
return dependencies.createNewUsage({ ...item, editorialId, maxPriceCents });
|
||||
return dependencies.createNewUsage({
|
||||
...item,
|
||||
editorialId,
|
||||
maxPriceCents,
|
||||
...(collab ? { collab: true } : {}),
|
||||
});
|
||||
}
|
||||
|
||||
async function parsePayload(request: Request) {
|
||||
@@ -285,6 +292,7 @@ function mappedBulkError(error: unknown): Response {
|
||||
USAGE_NOT_FOUND: 404,
|
||||
IMMICH_UNAVAILABLE: 503,
|
||||
EDITORIAL_NOT_ACTIVE: 403,
|
||||
COLLAB_NOT_ENABLED: 403,
|
||||
INVALID_PRICE: 409,
|
||||
};
|
||||
return jsonError(statusByCode[error.code] ?? 500, error.code);
|
||||
|
||||
Reference in new issue
Block a user