Skip to content

Commit 9b3658d

Browse files
committed
Disabled autoupdate + Doc update
1 parent 22667b1 commit 9b3658d

File tree

4 files changed

+51
-242
lines changed

4 files changed

+51
-242
lines changed

README.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Only Emulsion does it this way ; Seriously, look it up!
3939
- **Reproducible** - One config file = instant gaming PC setup
4040
- **Arcade Ready** - Perfect for driving an arcade cabinet
4141

42-
![Emulsion Hero](https://yphil.gitlab.io/images/emulsion-screenshot_03.png?cache=x)
42+
![Emulsion Hero](https://yphil.gitlab.io/images/emulsion-list-pce.png?cache=x)
4343

4444
## Installation
4545

@@ -77,7 +77,7 @@ npm install && npm start
7777
7878
## Configuration
7979

80-
![Settings Screenshot](https://yphil.gitlab.io/images/emulsion-01-platform_config.png?xxx)
80+
![Settings Screenshot](https://yphil.gitlab.io/images/emulsion-prefs-snes.png?xxx)
8181

8282
### Per-Platform Settings
8383

@@ -89,30 +89,46 @@ npm install && npm start
8989
| **Get all cover images** | Batch download of all this platform's game covers artwork (you can close the menu and do something else - like play a game - while it downloads and refreshes your games gallery in real time) |
9090
| **Extensions** | File types to scan for (e.g., `.zip`, `.iso`) |
9191

92-
## Cover Art
92+
## Emulators management
9393

94-
Press <kbd>□</kbd> or <kbd>I</kbd> to select the cover art for the selected game.
94+
Emulsion finds your emulators, helps you install the ones you don’t have, and sets them up with sensible defaults (file extensions and CLI arguments) — all configurable. Emulsion is *flexible*: You can put all your Vic20 games in the C64 page if you want.
9595

96-
### API Keys (Optional but Recommended)
96+
![Emulators management](https://yphil.gitlab.io/images/emulsion-emulators-n64.png?cache=x)
9797

98-
Get **way more images** by adding these free API keys:
98+
Up-to-date on Linux emulators and the way they work ; Smart, [DWIM](https://en.wikipedia.org/wiki/DWIM) & and hassle-free.
99+
100+
## Game Metadata & Cover Art
101+
102+
Press <kbd>□</kbd> or <kbd>I</kbd> to select the cover art for the selected platform / game.
103+
104+
By default, Emulsion uses Wikipedia to fetch cover images and game metadata — so even without any setup, you get images, release info, and other useful text details automatically.
105+
106+
### Optional: Add API Keys for More Images & Data
107+
108+
Want more options and higher-quality covers? Add free API keys to expand Emulsion’s reach:
99109

100110
#### SteamGridDB
101-
1. Login at [steamgriddb.com](https://www.steamgriddb.com/)
102-
2. Get your key from Preferences
103-
3. Paste into Emulsion Settings
111+
112+
- Login at steamgriddb.com
113+
- Get your API key from Preferences
114+
- Paste it into Emulsion Settings
104115

105116
#### GiantBomb
106-
1. Get your free key at [giantbomb.com/api](https://www.giantbomb.com/api/)
107-
2. Paste into Emulsion Settings
108117

109-
### All Image Sources
118+
- Register at giantbomb.com/api
119+
- Paste your free key into Emulsion Settings
120+
121+
#### Text Sources
122+
123+
- Wikipedia – default, text metadata (title, release date, description, etc.)
124+
125+
#### Image Sources
110126

111-
- [SteamGridDB](https://www.steamgriddb.com/) (API - Best coverage)
112-
- [GiantBomb](https://www.giantbomb.com/api/) (API - Great metadata)
113-
- [Wikipedia](https://en.wikipedia.org/) (API - Surprising)
127+
- Wikipedia – default, finds both images and basic text metadata (title, release date, description, etc.)
128+
- SteamGridDB – API, best coverage for high-quality images
129+
- GiantBomb – API, actually quite poor, thinking of removing it.
114130

115-
Images are saved to the platform games / roms directory.
131+
All images and metadata are saved alongside your platform games / ROMs, keeping your collection organized.
116132

117133
## Controls
118134

main.js

Lines changed: 16 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { app, BrowserWindow, ipcMain, shell, dialog, globalShortcut, Menu, session, Notification } from 'electron';
1+
import { app, BrowserWindow, ipcMain, shell, dialog, globalShortcut, Menu, session } from 'electron';
22
import fs from 'fs/promises';
33
import fsSync from 'fs';
44
import path from 'path';
@@ -9,17 +9,11 @@ import { getAllCoverImageUrls, getGameMetaData } from './src/js/backends.js';
99

1010
import { PLATFORMS, getPlatformInfo } from './src/js/platforms.js';
1111

12-
// Auto-updater
13-
import pkg from 'electron-updater';
14-
const { autoUpdater } = pkg;
15-
1612
import axios from 'axios';
1713
import os from 'os';
1814

1915

2016

21-
22-
2317
let childProcesses = new Map();
2418

2519
let gamecontroller = null;
@@ -905,60 +899,24 @@ ipcMain.handle('get-versions', async () => {
905899
return {current: pjson.version, latest: latestVersion};
906900
});
907901

908-
ipcMain.handle('check-for-updates', async () => {
909-
try {
910-
await autoUpdater.checkForUpdates();
911-
return { success: true };
912-
} catch (error) {
913-
console.error('Manual update check failed:', error);
914-
return { success: false, error: error.message };
915-
}
916-
});
917-
918-
ipcMain.handle('download-update', async () => {
919-
try {
920-
await autoUpdater.downloadUpdate();
921-
return { success: true };
922-
} catch (error) {
923-
console.error('Update download failed:', error);
924-
return { success: false, error: error.message };
925-
}
926-
});
927-
928-
ipcMain.handle('quit-and-install', async () => {
929-
const { exec } = require('child_process');
930-
const cachePath = path.join(app.getPath('userData'), '../../../../.cache/emulsion-updater/pending/emulsion_amd64.deb'); // assuming the path
902+
app.whenReady().then(() => {
931903

932-
try {
933-
await new Promise((resolve, reject) => {
934-
exec('which gksudo >/dev/null 2>&1', (error) => {
935-
const installCmd = `dpkg -i ${cachePath} || apt-get install -f -y -q`;
936-
let cmd;
937-
if (!error) {
938-
cmd = `gksudo "${installCmd}"`;
939-
} else {
940-
cmd = `pkexec /bin/bash -c "${installCmd}"`;
941-
}
942-
exec(cmd, (installError, stdout, stderr) => {
943-
if (installError) {
944-
console.error('Install error:', installError, stderr);
945-
reject(installError);
946-
} else {
947-
resolve();
948-
}
949-
});
950-
});
904+
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
905+
callback({
906+
responseHeaders: {
907+
...details.responseHeaders,
908+
"Access-Control-Allow-Origin": ["*"], // Allow all origins
909+
"Access-Control-Allow-Methods": ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
910+
"Access-Control-Allow-Headers": ["*"]
911+
}
951912
});
952-
} catch (error) {
953-
// Show notification for manual install
954-
new Notification({
955-
title: 'Install Failed',
956-
body: 'Please install update manually: sudo dpkg -i ' + cachePath + ' && sudo apt-get install -f -y'
957-
}).show();
958-
}
913+
});
959914

960-
app.relaunch({ args: process.argv.slice(1).concat(['--restarted']) });
961-
app.exit(0);
915+
createWindows();
916+
917+
globalShortcut.register('Ctrl+Shift+K', () => {
918+
killChildProcesses(childProcesses);
919+
});
962920
});
963921

964922
ipcMain.handle('install-flatpak', async (event, appId) => {
@@ -1160,78 +1118,3 @@ ipcMain.handle('get-flatpak-download-size', async (event, appId) => {
11601118
});
11611119
});
11621120
});
1163-
1164-
app.whenReady().then(() => {
1165-
// Auto-updater events
1166-
autoUpdater.on('checking-for-update', () => {
1167-
mainWindow.webContents.send('update-status', { status: 'checking' });
1168-
});
1169-
1170-
autoUpdater.on('update-available', (info) => {
1171-
new Notification({
1172-
title: 'Update Available',
1173-
body: `Emulsion ${info.version} is available for download`
1174-
}).show();
1175-
mainWindow.webContents.send('update-status', {
1176-
status: 'available',
1177-
version: info.version,
1178-
info
1179-
});
1180-
});
1181-
1182-
autoUpdater.on('update-not-available', (info) => {
1183-
new Notification({
1184-
title: 'No Updates Available',
1185-
body: 'You are running the latest version of Emulsion'
1186-
}).show();
1187-
mainWindow.webContents.send('update-status', { status: 'up-to-date' });
1188-
});
1189-
1190-
autoUpdater.on('error', (err) => {
1191-
new Notification({
1192-
title: 'Update Error',
1193-
body: `Failed to check for updates: ${err.message}`
1194-
}).show();
1195-
mainWindow.webContents.send('update-status', { status: 'error', error: err.message });
1196-
});
1197-
1198-
autoUpdater.on('download-progress', (progressObj) => {
1199-
const progress = Math.round(progressObj.percent);
1200-
const speedMBs = (progressObj.bytesPerSecond / 1024 / 1024).toFixed(2);
1201-
const downloadedMB = (progressObj.transferred / 1024 / 1024).toFixed(2);
1202-
const totalMB = (progressObj.total / 1024 / 1024).toFixed(2);
1203-
1204-
mainWindow.webContents.send('update-status', {
1205-
status: 'downloading',
1206-
progress: progress,
1207-
speed: speedMBs,
1208-
downloaded: downloadedMB,
1209-
total: totalMB
1210-
});
1211-
});
1212-
1213-
autoUpdater.on('update-downloaded', (info) => {
1214-
new Notification({
1215-
title: 'Update Downloaded',
1216-
body: 'Restart Emulsion to apply the update'
1217-
}).show();
1218-
mainWindow.webContents.send('update-status', { status: 'downloaded' });
1219-
});
1220-
1221-
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
1222-
callback({
1223-
responseHeaders: {
1224-
...details.responseHeaders,
1225-
"Access-Control-Allow-Origin": ["*"], // Allow all origins
1226-
"Access-Control-Allow-Methods": ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
1227-
"Access-Control-Allow-Headers": ["*"]
1228-
}
1229-
});
1230-
});
1231-
1232-
createWindows();
1233-
1234-
globalShortcut.register('Ctrl+Shift+K', () => {
1235-
killChildProcesses(childProcesses);
1236-
});
1237-
});

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.77",
3+
"version": "0.9.78",
44
"summary": "Better gaming throught chemistry",
55
"description": "Display your games collection into responsive galleries, manage game metadata, cover art and emulator configuration. Launch your games in style.",
66
"homepage": "https://yphil.gitlab.io/emulsion",

src/js/dialog.js

Lines changed: 2 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -264,98 +264,8 @@ export async function helpDialog(defaultTabId = null) {
264264
dialog.querySelector('.update-available').style.display = 'block';
265265
}
266266

267-
const upgradeButton = dialog.querySelector('button.upgrade');
268-
269-
// Create a new element for update status messages under the button
270-
const updateStatusElement = document.createElement('div');
271-
updateStatusElement.id = 'update-status-dialog';
272-
updateStatusElement.style.marginTop = '10px';
273-
updateStatusElement.style.fontSize = '0.9em';
274-
updateStatusElement.style.color = 'var(--accent, #3b82f6)';
275-
upgradeButton.insertAdjacentElement('afterend', updateStatusElement);
276-
277-
upgradeButton.textContent = 'Check for Updates';
278-
upgradeButton.addEventListener('click', async () => {
279-
try {
280-
const result = await ipcRenderer.invoke('check-for-updates');
281-
if (!result.success) {
282-
updateStatusElement.textContent = `Error: ${result.error}`;
283-
updateStatusElement.style.color = 'var(--error, #ef4444)';
284-
} else {
285-
updateStatusElement.textContent = 'Checking for updates...';
286-
updateStatusElement.style.color = 'var(--accent, #3b82f6)';
287-
}
288-
} catch (error) {
289-
updateStatusElement.textContent = `Error: ${error.message}`;
290-
updateStatusElement.style.color = 'var(--error, #ef4444)';
291-
}
292-
});
293-
294-
// Listen for update status changes from main process
295-
ipcRenderer.on('update-status', (event, status) => {
296-
switch (status.status) {
297-
case 'checking':
298-
updateStatusElement.textContent = 'Checking for updates...';
299-
updateStatusElement.style.color = 'var(--accent, #3b82f6)';
300-
upgradeButton.disabled = true;
301-
break;
302-
case 'available':
303-
updateStatusElement.textContent = `Update ${status.version} available! Click to download.`;
304-
updateStatusElement.style.color = 'var(--success, #10b981)';
305-
upgradeButton.textContent = 'Download Update';
306-
upgradeButton.disabled = false;
307-
upgradeButton.onclick = async () => {
308-
try {
309-
const downloadResult = await ipcRenderer.invoke('download-update');
310-
if (!downloadResult.success) {
311-
updateStatusElement.textContent = `Download failed: ${downloadResult.error}`;
312-
updateStatusElement.style.color = 'var(--error, #ef4444)';
313-
upgradeButton.disabled = false;
314-
} else {
315-
updateStatusElement.textContent = 'Starting download...';
316-
updateStatusElement.style.color = 'var(--accent, #3b82f6)';
317-
upgradeButton.disabled = true;
318-
}
319-
} catch (error) {
320-
updateStatusElement.textContent = `Download error: ${error.message}`;
321-
updateStatusElement.style.color = 'var(--error, #ef4444)';
322-
upgradeButton.disabled = false;
323-
}
324-
};
325-
break;
326-
case 'up-to-date':
327-
updateStatusElement.textContent = 'You are running the latest version.';
328-
updateStatusElement.style.color = 'var(--success, #10b981)';
329-
upgradeButton.disabled = false;
330-
upgradeButton.textContent = 'Check for Updates';
331-
break;
332-
case 'downloading':
333-
updateStatusElement.textContent = `Downloading... ${status.progress}% (${status.downloaded}/${status.total} MB @ ${status.speed} MB/s)`;
334-
updateStatusElement.style.color = 'var(--accent, #3b82f6)';
335-
upgradeButton.disabled = true;
336-
upgradeButton.textContent = 'Downloading...';
337-
break;
338-
case 'downloaded':
339-
updateStatusElement.textContent = 'Download complete! Restart to install.';
340-
updateStatusElement.style.color = 'var(--success, #10b981)';
341-
upgradeButton.textContent = 'Install & Restart';
342-
upgradeButton.disabled = false;
343-
upgradeButton.onclick = async () => {
344-
try {
345-
await ipcRenderer.invoke('quit-and-install');
346-
} catch (error) {
347-
updateStatusElement.textContent = `Install error: ${error.message}`;
348-
updateStatusElement.style.color = 'var(--error, #ef4444)';
349-
}
350-
};
351-
break;
352-
case 'error':
353-
updateStatusElement.textContent = `Update error: ${status.error}`;
354-
updateStatusElement.style.color = 'var(--error, #ef4444)';
355-
upgradeButton.disabled = false;
356-
upgradeButton.textContent = 'Check for Updates';
357-
break;
358-
}
267+
dialog.querySelector('button.upgrade').addEventListener('click', () => {
268+
ipcRenderer.invoke('go-to-url', 'https://github.com/yPhil-gh/Emulsion/releases');
359269
});
360270

361271
dialog.querySelector('button.btn-liberapay').addEventListener('click', () => {

0 commit comments

Comments
 (0)