feat: stream originals with download accounting

This commit is contained in:
Leon Tonhäuser committed 2026-08-10 13:10:13 +02:00
1 parent c400167b8f
commit 8871e4794a
28 files changed
+4081 -8

No files matched your search

+2 -1
View File
@@ -2,7 +2,7 @@ import "server-only";
import { randomUUID } from "node:crypto";
import { and, desc, eq, isNull, sql } from "drizzle-orm";
import { and, desc, eq, inArray, isNull, sql } from "drizzle-orm";
import type { NodePgDatabase } from "drizzle-orm/node-postgres";
import { db } from "@/db/client";
@@ -261,6 +261,7 @@ export function createUsageServiceRepository(
and(
eq(usages.editorialAccountId, editorialId),
eq(usages.immichAssetId, assetId),
inArray(usages.billingStatus, ["open", "billed", "reopened"]),
),
)
.orderBy(desc(usages.createdAt));