diff --git a/main.js b/main.js index be5d1a1..f51cf73 100644 --- a/main.js +++ b/main.js @@ -1090,11 +1090,16 @@ ipcMain.handle('remote:get-capture-source-id', async () => { debugLog('remote: capture source - mainWindow not available'); return null; } + // Use getMediaSourceId() for exact window capture without enumeration + const sourceId = mainWindow.getMediaSourceId(); + debugLog('remote: capture source - getMediaSourceId:', sourceId); + if (sourceId) return sourceId; + + // Fallback: enumerate sources const { desktopCapturer } = require('electron'); const sources = await desktopCapturer.getSources({ types: ['window', 'screen'] }); const title = mainWindow.getTitle(); - debugLog('remote: capture source - looking for title:', title, 'available:', sources.map(s => s.name).join(', ')); - // Try exact title match first, then partial match, then fall back to first screen + debugLog('remote: capture source - fallback, looking for title:', title); let source = sources.find(s => s.name === title); if (!source) source = sources.find(s => s.name.includes('Multi-Hoster')); if (!source) source = sources.find(s => s.id.startsWith('screen:')); diff --git a/package.json b/package.json index 11e6889..28ae785 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "multi-hoster-uploader", - "version": "2.1.6", + "version": "2.1.7", "description": "Upload files to doodstream, voe, vidmoly, byse simultaneously", "main": "main.js", "scripts": {