mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-11 02:46:16 -08:00
feat(epg): update worker path for packaged app and refine file inclusion in build
This commit is contained in:
1 parent
64afc2901e
commit
9f7995054d
2 files changed
+11
-29
No files matched your search
@@ -103,10 +103,15 @@ export default class EpgEvents {
|
||||
let workerPath: string;
|
||||
|
||||
if (app.isPackaged) {
|
||||
// In packaged app: Resources/app.asar.unpacked/workers/epg-parser.worker.js
|
||||
// In packaged app: Resources/app.asar.unpacked/electron-backend/workers/epg-parser.worker.js
|
||||
const appPath = app.getAppPath();
|
||||
const unpackedPath = appPath.replace('app.asar', 'app.asar.unpacked');
|
||||
workerPath = path.join(unpackedPath, 'workers', 'epg-parser.worker.js');
|
||||
workerPath = path.join(
|
||||
unpackedPath,
|
||||
'electron-backend',
|
||||
'workers',
|
||||
'epg-parser.worker.js'
|
||||
);
|
||||
} else {
|
||||
// In development: dist/apps/electron-backend/workers/epg-parser.worker.js
|
||||
workerPath = path.join(__dirname, 'workers', 'epg-parser.worker.js');
|
||||
@@ -116,31 +121,6 @@ export default class EpgEvents {
|
||||
console.log(this.loggerLabel, 'Worker path:', workerPath);
|
||||
console.log(this.loggerLabel, 'App path:', app.getAppPath());
|
||||
console.log(this.loggerLabel, 'Is packaged:', app.isPackaged);
|
||||
console.log(this.loggerLabel, '__dirname:', __dirname);
|
||||
|
||||
// Check if file exists
|
||||
const fs = require('fs');
|
||||
if (!fs.existsSync(workerPath)) {
|
||||
console.error(this.loggerLabel, 'Worker file does not exist at:', workerPath);
|
||||
console.error(this.loggerLabel, 'Trying alternate paths...');
|
||||
|
||||
// Try alternate path with electron-backend subdirectory
|
||||
const alternatePath = path.join(
|
||||
app.getAppPath().replace('app.asar', 'app.asar.unpacked'),
|
||||
'electron-backend',
|
||||
'workers',
|
||||
'epg-parser.worker.js'
|
||||
);
|
||||
console.error(this.loggerLabel, 'Alternate path:', alternatePath);
|
||||
|
||||
if (fs.existsSync(alternatePath)) {
|
||||
workerPath = alternatePath;
|
||||
console.log(this.loggerLabel, 'Using alternate path');
|
||||
} else {
|
||||
reject(new Error(`Worker file not found at ${workerPath} or ${alternatePath}`));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let worker: Worker;
|
||||
try {
|
||||
|
||||
+4
-2
@@ -24,11 +24,13 @@
|
||||
"productName": "IPTVnator",
|
||||
"artifactName": "${name}-${version}-${os}-${arch}.${ext}",
|
||||
"files": [
|
||||
"**/*",
|
||||
"electron-backend/**/*",
|
||||
"web/**/*",
|
||||
"remote-control-web/**/*",
|
||||
"!**/*.map"
|
||||
],
|
||||
"asarUnpack": [
|
||||
"workers/**/*.js"
|
||||
"electron-backend/workers/**"
|
||||
],
|
||||
"mac": {
|
||||
"target": {
|
||||
|
||||
Reference in new issue
Block a user