썸네일이 누락된 파일 조회 및 레거시 파일 조회 네트워크 호출 최적화

This commit is contained in:
static
2026-01-15 20:33:27 +09:00
parent ebcdbd2d83
commit fe83a71a1f
16 changed files with 367 additions and 174 deletions

View File

@@ -97,11 +97,41 @@ const fileRouter = router({
}),
listWithoutThumbnail: roleProcedure["activeClient"].query(async ({ ctx }) => {
return await MediaRepo.getMissingFileThumbnails(ctx.session.userId);
const files = await FileRepo.getFilesWithoutThumbnail(ctx.session.userId);
return files.map((file) => ({
id: file.id,
isLegacy: !!file.encContentIv,
parent: file.parentId,
mekVersion: file.mekVersion,
dek: file.encDek,
dekVersion: file.dekVersion,
contentType: file.contentType,
name: file.encName.ciphertext,
nameIv: file.encName.iv,
createdAt: file.encCreatedAt?.ciphertext,
createdAtIv: file.encCreatedAt?.iv,
lastModifiedAt: file.encLastModifiedAt.ciphertext,
lastModifiedAtIv: file.encLastModifiedAt.iv,
}));
}),
listLegacy: roleProcedure["activeClient"].query(async ({ ctx }) => {
return await FileRepo.getLegacyFileIds(ctx.session.userId);
const files = await FileRepo.getLegacyFiles(ctx.session.userId);
return files.map((file) => ({
id: file.id,
isLegacy: true,
parent: file.parentId,
mekVersion: file.mekVersion,
dek: file.encDek,
dekVersion: file.dekVersion,
contentType: file.contentType,
name: file.encName.ciphertext,
nameIv: file.encName.iv,
createdAt: file.encCreatedAt?.ciphertext,
createdAtIv: file.encCreatedAt?.iv,
lastModifiedAt: file.encLastModifiedAt.ciphertext,
lastModifiedAtIv: file.encLastModifiedAt.iv,
}));
}),
rename: roleProcedure["activeClient"]