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 updateTotalCountDebounce = null;
1335 try {
1336 const totalCount = await window.electron.getTotalModelCount();
1337 const totalElement = document.getElementById('total-count');
1338 if (totalElement) {
1339 totalElement.textContent = `${totalCount} model${totalCount !== 1 ? 's' : ''} total`;
1340 }
1341 } catch (error) {
1342 console.error('Error updating total model count:', error);
1343 }
1344 }, 350);
1345}
1346
1347// Add these functions near the top of the file
1348async function updateModelCounts(viewCount) {
1349 try {
1350 const viewElement = document.getElementById('view-count');
1351 if (viewElement) {
1352 viewElement.textContent = `${viewCount} model${viewCount !== 1 ? 's' : ''} in view`;
1353 }
1354 scheduleTotalModelCountRefresh();
1355 } catch (error) {
1356 console.error('Error updating model counts:', error);
1357 }
1358}
1359
1360// Helper function to normalize paths for comparison
1361// This handles URL encoding, path separators, and whitespace differences
1362function normalizePathForComparison(path) {
1363 if (!path) return '';
1364 // Decode URL encoding if present
1365 let normalized = path;

Callers 3

displayModelsFunction · 0.85
renderFilesFunction · 0.85
renderVirtualGridFunction · 0.85

Calls 1

getGridModelDedupeKeyFunction · 0.85

Tested by

no test coverage detected