(path)
| 7269 | }); |
| 7270 | |
| 7271 | if (!result.canceled && result.filePaths.length > 0) { |
| 7272 | try { |
| 7273 | const fileContent = await fs.promises.readFile(result.filePaths[0], 'utf8'); |
| 7274 | const importData = JSON.parse(fileContent); |
| 7275 | return await importLibraryData(importData); |
| 7276 | } catch (error) { |
| 7277 | console.error('Import library error:', error); |
| 7278 | if (event && event.sender) { |
| 7279 | event.sender.send('close-progress-dialog'); |