mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
feat(electron): load epg worker from asar.unpacked in prod
Update EPG worker path handling and unpack worker files for production builds so the worker can be spawned when the app is packaged with ASAR. - Change workerPath to let and, when the resolved path includes app.asar, replace it with app.asar.unpacked. This ensures the spawned worker points to the unpacked resource in production. - Add electron-builder asarUnpack pattern for workers/** so worker files are packaged outside the ASAR archive. These changes fix runtime errors where worker threads cannot be started from inside app.asar and ensure the EPG parser can run in packaged apps.
This commit is contained in:
1 parent
573ca01925
commit
5b697f458a
2 files changed
+9
-1
No files matched your search
@@ -97,12 +97,17 @@ export default class EpgEvents {
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const workerPath = path.join(
|
||||
let workerPath = path.join(
|
||||
__dirname,
|
||||
'workers',
|
||||
'epg-parser.worker.js'
|
||||
);
|
||||
|
||||
// Handle asar unpacked files in production
|
||||
if (workerPath.includes('app.asar')) {
|
||||
workerPath = workerPath.replace('app.asar', 'app.asar.unpacked');
|
||||
}
|
||||
|
||||
console.log(this.loggerLabel, 'Creating worker for:', url);
|
||||
console.log(this.loggerLabel, 'Worker path:', workerPath);
|
||||
|
||||
|
||||
Reference in new issue
Block a user