Merge branch 'develop' into more-fixes

This commit is contained in:
Husky
2025-05-29 13:58:27 -04:00
committed by GitHub
2 changed files with 21 additions and 9 deletions

View File

@ -273,11 +273,14 @@ export class MetadataHandler {
continue;
}
// If we're successful
await pullObjects();
const object = await prisma.company.create({
data: {
const object = await prisma.company.upsert({
where: {
metadataKey: {
metadataSource: provider.source(),
metadataId: result.id,
},
},
create: {
metadataSource: provider.source(),
metadataId: result.id,
metadataOriginalQuery: query,
@ -289,8 +292,15 @@ export class MetadataHandler {
mBannerObjectId: result.banner,
mWebsite: result.website,
},
update: {},
});
if (object.mLogoObjectId == result.logo) {
// We created, and didn't update
// So pull objects
await pullObjects();
}
return object;
}