Skip to content

Commit eab4f65

Browse files
committed
fix: Resolve grid state and stream lifecycle issues
1 parent 84f213c commit eab4f65

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

main.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { app, BrowserWindow, ipcMain, Menu, clipboard, dialog } = require('electron');
22
const path = require('path');
3-
const fs = require('fs'); // Для синхронных проверок
4-
const fsPromises = require('fs').promises; // Для асинхронных операций
3+
const fs = require('fs');
4+
const fsPromises = require('fs').promises;
55
const net = require('net');
66
const os = require('os');
77
const { spawn, exec } = require('child_process');
@@ -12,26 +12,23 @@ const dgram = require('dgram');
1212
const crypto = require('crypto');
1313
const ffmpeg = require('@ffmpeg-installer/ffmpeg');
1414

15-
const ffmpegPath = ffmpeg.path;
15+
// --- ИСПРАВЛЕНИЕ ЗДЕСЬ ---
16+
const ffmpegPath = ffmpeg.path.replace('app.asar', 'app.asar.unpacked');
17+
// -------------------------
1618

1719
let mainWindow = null;
1820
const streamManager = {};
1921
const usedPorts = new Set();
2022
const BASE_PORT = 9001;
2123

2224
function getDataPath() {
23-
// В режиме разработки используем стандартный путь, чтобы не засорять папку проекта
2425
if (!app.isPackaged) {
2526
return app.getPath('userData');
2627
}
27-
28-
// В упакованном приложении проверяем наличие файла-маркера
2928
const portableMarkerPath = path.join(path.dirname(app.getPath('exe')), 'portable.txt');
3029
if (fs.existsSync(portableMarkerPath)) {
31-
// Портативный режим: используем папку с exe
3230
return path.dirname(app.getPath('exe'));
3331
} else {
34-
// Стандартный режим: используем AppData/итд
3532
return app.getPath('userData');
3633
}
3734
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openipc-dashboard",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "App for managing OpenIPC cameras",
55
"main": "main.js",
66
"scripts": {

0 commit comments

Comments
 (0)