feat(imports): job claims carry IMVU's rating (#19)
Release / release (push) Successful in 4s
CI / test (push) Successful in 1m35s
CI / image (apps/api/Dockerfile, t5de-hub-api) (push) Successful in 4s
CI / image (apps/web/Dockerfile, t5de-hub-web) (push) Successful in 18s

Co-authored-by: dhkatz <[email protected]>
This commit was merged in pull request #19.
This commit is contained in:
dhkatz authored and dhkatz committed 2026-11-08 14:37:33 +00:00
1 parent 79c98078cb
commit 56d25f7507
4 files changed
+14 -4

No files matched your search

+9
View File
@@ -821,11 +821,20 @@ export class Imports {
.where(inArray(product.imvuProduct, jobs.map((j) => j.imvuProduct)))
.groupBy(product.imvuProduct)
: [];
// IMVU's rating, as the hub knows it: the importer writes it into index.xml (IMVU's files have no ProductRating),
// so the files agree with the revision's rating (the higher of the two).
const infos = jobs.length
? await this.db
.select({ id: imvuProductInfo.id, rating: imvuProductInfo.rating })
.from(imvuProductInfo)
.where(and(inArray(imvuProductInfo.id, jobs.map((j) => j.imvuProduct)), eq(imvuProductInfo.found, true)))
: [];
return jobs.map((j) => ({
id: j.id,
kind: j.kind,
imvuProduct: j.imvuProduct,
lastRevision: last.find((l) => l.imvuProduct === j.imvuProduct)?.imvuRevision ?? 0,
rating: infos.find((i) => i.id === j.imvuProduct)?.rating ?? null,
}));
}