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

Function processRenderQueue

renderer.js:12744–12787  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12742 }
12743 // Instead of filtering just by directory here, trigger the combined search which applies all filters.
12744 // The updateFilterIndicator function in search.js will handle displaying the filter correctly
12745 if (typeof window.performCombinedSearch === 'function') {
12746 await window.performCombinedSearch();
12747 }
12748 });
12749
12750 fileInfo.appendChild(parentDirElement);
12751
12752
12753
12754 const fileDetails = document.createElement('div');
12755 fileDetails.className = 'file-details';
12756 fileDetails.innerHTML = `<span class="directory-label">Size:
12757 <span>${file.size? formatFileSize(file.size): ''}</span>
12758 `;
12759 fileInfo.appendChild(fileDetails);
12760 fileElement.appendChild(fileInfo);
12761
12762 fileElement.addEventListener('click', () => {
12763 toggleModelSelection(fileElement, file.filePath);
12764 });
12765 // Designer info is now shown in metadata section, so we don't need it here
12766 // Removed redundant designer info display
12767
12768 if (!file.thumbnail &&!skipThumbnail) {
12769 const fileExtension = file.filePath.split('.').pop().toLowerCase();
12770 if (fileExtension === '3mf') {
12771 try {
12772 const images = await window.electron.get3MFImages(file.filePath);
12773 if (images && images.length > 0) {
12774 const firstImage = images[0];
12775 console.log(`[DEBUG] renderFile: Using ${images.length} embedded image(s) from 3MF: ${file.filePath}`);
12776 const img = document.createElement('img');
12777 img.src = firstImage;
12778 img.className = 'model-thumbnail';
12779 thumbnailContainer.innerHTML = '';
12780 thumbnailContainer.appendChild(img);
12781 thumbnailContainer.classList.remove('loading');
12782
12783 await window.electron.addMultipleThumbnails(file.filePath, images);
12784 file.thumbnail = firstImage;
12785
12786 return fileElement;
12787 } else {
12788 console.log(`[DEBUG] renderFile: No embedded images found in 3MF: ${file.filePath}`);
12789 }
12790 } catch (imageError) {

Callers 4

scanAndRenderDirectoryFunction · 0.85
renderFileFunction · 0.85
createModelItemFunction · 0.85
renderVisibleItemsFunction · 0.85

Calls 5

dequeueNextRenderTaskFunction · 0.85
renderModelToPNGFunction · 0.85

Tested by

no test coverage detected