()
| 17110 | if (!thumbnail) { |
| 17111 | thumbnail = await new Promise((resolve, reject) => { |
| 17112 | renderQueue.push({ |
| 17113 | filePath: file.filePath, |
| 17114 | container: document.createElement('div'), // Dummy container (not in DOM) |
| 17115 | existingThumbnail: null, |
| 17116 | resolve, |
| 17117 | reject, |
| 17118 | // Must survive pruneDisconnectedRenderTasks — dummy is never isConnected. |
| 17119 | retainDetached: true, |
| 17120 | thumbPriority: THUMB_PRIORITY_BACKGROUND |
| 17121 | }); |
| 17122 | processRenderQueue(); |
| 17123 | }); |
| 17124 | |
| 17125 | if (thumbnail) { |
| 17126 | await window.electron.saveThumbnail(file.filePath, thumbnail); |
| 17127 | } |
| 17128 | } |
| 17129 | |
| 17130 | // Calculate and save hash during thumbnail generation (file is already being read) |
| 17131 | if (!file.hash || file.hash === '') { |
| 17132 | try { |
| 17133 | await window.electron.calculateFileHash(file.filePath); |
| 17134 | } catch (hashError) { |
| 17135 | console.error(`Error calculating hash for ${file.filePath}:`, hashError); |
no test coverage detected