MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / dedupeModelsForVirtualGrid

Function dedupeModelsForVirtualGrid

renderer.js:1336–1362  ·  view source on GitHub ↗

One row per filesystem / zip entry — duplicate DB rows share the same normalized path.

(models)

Source from the content-addressed store, hash-verified

1334 const queued = findQueuedThumbnailTask(model.filePath);
1335 if (queued) {
1336 queued.container = thumbContainer;
1337 if (thumbPriority != null) queued.thumbPriority = thumbPriority;
1338 pendingThumbnails.add(model.filePath);
1339 return true;
1340 }
1341 if (activeThumbnailRenders.has(model.filePath)) {
1342 pendingThumbnails.add(model.filePath);
1343 return false;
1344 }
1345 // Stale pending bit (dropped while a race left the flag set)
1346 if (pendingThumbnails.has(model.filePath)) {
1347 pendingThumbnails.delete(model.filePath);
1348 }
1349
1350 pendingThumbnails.add(model.filePath);
1351 enqueueRenderTask({
1352 filePath: model.filePath,
1353 container: thumbContainer,
1354 thumbPriority: thumbPriority != null ? thumbPriority : 0,
1355 resolve: async (thumbnail) => {
1356 pendingThumbnails.delete(model.filePath);
1357 if (!thumbnail || thumbnail === '3d.png' || isFailurePlaceholderThumbnail(thumbnail)) {
1358 // Image-only extract miss: never re-hydrate (cannot mesh-render).
1359 if (hasImageOnlyPreviewMiss(model.filePath)) {
1360 const liveImg = thumbContainer.querySelector('img');
1361 if (liveImg) {
1362 liveImg.src = thumbnail && thumbnail !== '3d.png'
1363 ? thumbnail
1364 : generateTypedPlaceholder(extensionFromModelPath(model.filePath));
1365 }

Callers 3

displayModelsFunction · 0.85
renderFilesFunction · 0.85
renderVirtualGridFunction · 0.85

Calls 1

getGridModelDedupeKeyFunction · 0.85

Tested by

no test coverage detected