One row per filesystem / zip entry — duplicate DB rows share the same normalized path.
(models)
| 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 |
| 1348 | async 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 |
| 1362 | function normalizePathForComparison(path) { |
| 1363 | if (!path) return ''; |
| 1364 | // Decode URL encoding if present |
| 1365 | let normalized = path; |
no test coverage detected