From 81e80c7e2f7c25ac9afbd921f7aafe70d6ef352a Mon Sep 17 00:00:00 2001 From: jmartin Date: Fri, 24 Jul 2026 11:13:11 -0400 Subject: [PATCH] Infer ArtStation categories from Blender/sculpt tools Stop defaulting imports to CAD; map Blender to 3D Modeling and sculpt tools (Nomad/ZBrush) to 3D Sculpting. --- server/src/routes/admin-meta.ts | 1 - server/src/services/artstation-import.ts | 24 +++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/server/src/routes/admin-meta.ts b/server/src/routes/admin-meta.ts index 2eff91d..1011154 100644 --- a/server/src/routes/admin-meta.ts +++ b/server/src/routes/admin-meta.ts @@ -306,7 +306,6 @@ export async function adminMetaRoutes(app: FastifyInstance) { dryRun: body.dryRun, publish: body.publish, url: body.url, - defaultCad: true, }); if (!started) { diff --git a/server/src/services/artstation-import.ts b/server/src/services/artstation-import.ts index 802594e..4c11d07 100644 --- a/server/src/services/artstation-import.ts +++ b/server/src/services/artstation-import.ts @@ -44,8 +44,6 @@ export interface ImportOptions { dryRun?: boolean; /** Publish new imports instead of leaving as draft */ publish?: boolean; - /** Assign CAD when no category matched */ - defaultCad?: boolean; onLog?: (line: string) => void; } @@ -238,9 +236,25 @@ async function importProject( const tags = detail.tags || []; let categoryIds = await resolveCategoryIds([...mediums, ...cats]); - if (categoryIds.length === 0 && opts.defaultCad !== false) { - const cad = await prisma.category.findUnique({ where: { slug: "cad" } }); - if (cad) categoryIds = [cad.id]; + // Infer from software / description when ArtStation has no useful medium tags + if (categoryIds.length === 0) { + const hay = `${software.join(" ")} ${detail.title} ${detail.description || ""}`.toLowerCase(); + let slug: string | null = null; + if ( + hay.includes("nomad sculpt") || + hay.includes("zbrush") || + (detail.title.toLowerCase().includes("mogwai") && hay.includes("sculpt")) + ) { + slug = "3d-sculpting"; + } else if (hay.includes("blender") || hay.includes("maya") || hay.includes("3d model")) { + slug = "3d-modeling"; + } else if (hay.includes("solidworks") || hay.includes("fusion 360") || /\bcad\b/.test(hay)) { + slug = "cad"; + } + if (slug) { + const cat = await prisma.category.findUnique({ where: { slug } }); + if (cat) categoryIds = [cat.id]; + } } log(