mirror of
https://github.com/A-Star100/simpliplay-desktop.git
synced 2025-09-17 22:29:38 +00:00
Update main.js
Added URL encoding for Windows file explorer opens
This commit is contained in:
parent
361c6bb7c5
commit
12a0c892f0
@ -3,7 +3,7 @@ const path = require('path');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const { pathToFileURL } = require("url");
|
||||
var didRegisterShortcuts = false;
|
||||
let didRegisterShortcuts = false;
|
||||
|
||||
let mainWindow;
|
||||
|
||||
@ -226,7 +226,8 @@ function openFileSafely(filePath) {
|
||||
|
||||
if (mainWindow?.webContents) {
|
||||
mainWindow.webContents.once("did-finish-load", () => {
|
||||
mainWindow.webContents.send("play-media", filePath);
|
||||
const winFileURL = pathToFileURL(filePath).href; // ✅ Convert and encode file path
|
||||
mainWindow.webContents.send("play-media", winFileURL);
|
||||
});
|
||||
}
|
||||
|
||||
@ -238,10 +239,6 @@ function isValidFileArg(arg) {
|
||||
return arg && !arg.startsWith('-') && !arg.includes('electron') && fs.existsSync(arg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
app.on("window-all-closed", () => {
|
||||
globalShortcut.unregisterAll();
|
||||
app.quit();
|
||||
|
Loading…
Reference in New Issue
Block a user