mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
feat(video-assets): add full video asset system (uploads, downloads, @mentions, and cleanup/billing integration)
This commit is contained in:
@@ -142,16 +142,28 @@ async function findReferencedVideoIds(videoIds: string[]): Promise<Set<string>>
|
||||
const referenced = new Set<string>();
|
||||
|
||||
for (const group of chunk(videoIds, CHUNK_SIZE)) {
|
||||
const rows = await db.videoVersion.findMany({
|
||||
where: {
|
||||
providerId: 'bunny',
|
||||
videoId: { in: group },
|
||||
},
|
||||
select: { videoId: true },
|
||||
});
|
||||
rows.forEach((row) => {
|
||||
const [versionRows, assetRows] = await Promise.all([
|
||||
db.videoVersion.findMany({
|
||||
where: {
|
||||
providerId: 'bunny',
|
||||
videoId: { in: group },
|
||||
},
|
||||
select: { videoId: true },
|
||||
}),
|
||||
db.videoAsset.findMany({
|
||||
where: {
|
||||
provider: 'BUNNY',
|
||||
providerVideoId: { in: group },
|
||||
},
|
||||
select: { providerVideoId: true },
|
||||
}),
|
||||
]);
|
||||
versionRows.forEach((row) => {
|
||||
if (row.videoId) referenced.add(row.videoId);
|
||||
});
|
||||
assetRows.forEach((row) => {
|
||||
if (row.providerVideoId) referenced.add(row.providerVideoId);
|
||||
});
|
||||
}
|
||||
|
||||
return referenced;
|
||||
|
||||
Reference in New Issue
Block a user