Skip to content

Commit 337ad17

Browse files
committed
~/Documents/Games/
1 parent 8266275 commit 337ad17

File tree

5 files changed

+9
-20
lines changed

5 files changed

+9
-20
lines changed

main.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ function loadPreferences() {
275275
platformPreferences === null ||
276276
typeof platformPreferences.isEnabled !== 'boolean' ||
277277
typeof platformPreferences.viewMode !== 'string' ||
278-
typeof platformPreferences.gamesDir !== 'string' ||
279278
typeof platformPreferences.emulator !== 'string' ||
280279
typeof platformPreferences.emulatorArgs !== 'string' ||
281280
!Array.isArray(platformPreferences.extensions)
@@ -742,7 +741,6 @@ const defaultPreferences = {
742741
PLATFORMS.forEach((platform, index) => {
743742
defaultPreferences[platform.name] = {
744743
isEnabled: false,
745-
gamesDir: "",
746744
viewMode: "grid",
747745
emulator: "",
748746
emulatorArgs: "",
@@ -1121,19 +1119,9 @@ ipcMain.handle("select-file-or-directory", async (event, property) => {
11211119
console.log("🌍 Running in Flatpak?", isFlatpak);
11221120

11231121
try {
1124-
if (property === "openDirectory" && isFlatpak) {
1125-
console.log("🔍 Using portal picker for directory (Flatpak)...");
1126-
try {
1127-
const result = await pickFolderPersist();
1128-
console.log("🔄 Portal picker result:", result);
1129-
return result?.path || null;
1130-
} catch (portalError) {
1131-
console.error("🔄 Portal picker failed:", portalError);
1132-
console.log("❌ Portal error - falling back to native dialog");
1133-
}
1134-
}
1122+
// Flatpak with working portals would be ideal, but crashes with V8 sandbox
1123+
// For now, just use Electron dialogs with available filesystem permissions
11351124

1136-
// Fallback to Electron native dialogs (always for file picker, and fallback for directories)
11371125
console.log("🔍 Using Electron native dialog for", property);
11381126
const result = await dialog.showOpenDialog({
11391127
title: property === 'openDirectory' ? 'Choose a folder' : 'Choose a file',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "emulsion",
3-
"version": "0.9.48",
3+
"version": "0.9.49",
44
"summary": "Better gaming throught chemistry",
55
"description": "Emulsion is a modern, responsive game launcher that organizes platforms into galleries, manages game metadata and cover art, and launches titles through configured emulators.",
66
"homepage": "https://yphil.gitlab.io/emulsion",

src/js/backends/giantbomb.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// src/js/backends/giantbomb.js
22
import axios from 'axios';
33

4+
// Note: Removed unused 'import os from 'os';' line that was causing module resolution errors
5+
46
export const fetchImages = async (gameName, apiKey) => {
57

68
if (!apiKey) {

src/js/gallery.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function buildGalleries (preferences, userDataPath) {
3333
extensions = 'none';
3434
index = 0; // Settings is always index 0
3535
} else {
36-
gamesDir = prefs.gamesDir;
36+
gamesDir = path.join(require('os').homedir(), 'Documents', 'Games', platformName);
3737
viewMode = prefs.viewMode;
3838
emulator = prefs.emulator;
3939
emulatorArgs = prefs.emulatorArgs;
@@ -263,7 +263,7 @@ export async function buildGameContainer({
263263
index
264264
}) {
265265
const container = document.createElement('div');
266-
const gamesDir = LB.preferences[platform].gamesDir;
266+
const gamesDir = path.join(require('os').homedir(), 'Documents', 'Games', platform);
267267
const cleanName = cleanFileName(gameName);
268268
const coverPath = await findImageFile(path.join(gamesDir, 'images'), gameName);
269269
const platformBadge = document.createElement('div');
@@ -501,4 +501,3 @@ export function buildEmptyPageGameContainer(platform, gamesDir) {
501501

502502
return container;
503503
}
504-

src/js/menu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ function buildPlatformMenuForm(platformName) {
541541
gamesDirCtn.appendChild(gamesDirInput);
542542
gamesDirCtn.appendChild(gamesDirButton);
543543

544-
gamesDirGroup.appendChild(gamesDirLabel);
544+
gamesDirGroup.style.display = 'none';
545545
gamesDirGroup.appendChild(gamesDirCtn);
546546

547547
const emulatorGroup = document.createElement('div');
@@ -1167,7 +1167,7 @@ function buildManualSelectButton(gameName, platformName, imgElem) {
11671167
const srcPath = await ipcRenderer.invoke('pick-image');
11681168
if (!srcPath) return; // user cancelled
11691169

1170-
const gamesDir = window.LB.preferences[platformName].gamesDir;
1170+
const gamesDir = (typeof os !== 'undefined' ? require('os').homedir() : require('os').homedir()) + '/Documents/Games/' + platformName;
11711171

11721172
const extension = srcPath.split('.').pop();
11731173

0 commit comments

Comments
 (0)