Skip to content

Commit ccde1be

Browse files
authored
Merge pull request #213 from entrylabs/develop
version up 2.1.20
2 parents 76a19b7 + 94e5126 commit ccde1be

File tree

7 files changed

+61
-135
lines changed

7 files changed

+61
-135
lines changed

build/entryx64.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
!define MUI_UNICON "icon.ico"
1414
!define PRODUCT_NAME "Entry"
1515
!define APP_NAME "Entry.exe"
16-
!define PRODUCT_VERSION "2.1.19"
16+
!define PRODUCT_VERSION "2.1.20"
1717
!define PRODUCT_PUBLISHER "EntryLabs"
1818
!define PRODUCT_WEB_SITE "http://www.playentry.org/"
1919

build/entryx86.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
!define MUI_UNICON "icon.ico"
1414
!define PRODUCT_NAME "Entry"
1515
!define APP_NAME "Entry.exe"
16-
!define PRODUCT_VERSION "2.1.19"
16+
!define PRODUCT_VERSION "2.1.20"
1717
!define PRODUCT_PUBLISHER "EntryLabs"
1818
!define PRODUCT_WEB_SITE "http://www.playentry.org/"
1919

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"productName": "Entry",
44
"name": "entry",
5-
"version": "2.1.19",
5+
"version": "2.1.20",
66
"description": "Entry for offline",
77
"main": "src/main_build/main.bundle.js",
88
"scripts": {
@@ -39,8 +39,8 @@
3939
"async-csv": "^2.1.3",
4040
"axios": "^0.19.2",
4141
"cross-spawn": "^7.0.3",
42-
"entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.57_2",
43-
"entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.19",
42+
"entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.58_2",
43+
"entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.20",
4444
"entry-tool": "git+https://github.com/entrylabs/entry-tool.git#dist/20231026",
4545
"@entrylabs/legacy-video": "^1.0.0",
4646
"excel4node": "^1.7.0",
@@ -59,7 +59,7 @@
5959
"sass": "^1.57.1",
6060
"socket.io": "^2.2.0",
6161
"socket.io-client": "^2.2.0",
62-
"tar": "^4.4.10",
62+
"tar": "^6.1.11",
6363
"uid": "^0.0.2",
6464
"winston": "^3.2.1",
6565
"winston-daily-rotate-file": "^4.4.2",

src/main/constants.ts

Lines changed: 31 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,24 @@ export default class {
77
return {
88
fromExternal: (fileUrl) => {
99
let result = fileUrl.replace(/%5C/gi, '\\'); // 1.6.x 버전 대응
10-
if (result.startsWith('./bower_components')) { // 웹 기본 오브젝트 대응
10+
if (result.startsWith('./bower_components')) {
11+
// 웹 기본 오브젝트 대응
1112
result = result
1213
.replace('./bower_components', '../../../node_modules')
1314
.replace('entryjs', 'entry-js'); // 과거 웹 WS 대응
14-
} else if (result.startsWith('/lib')) { // 신규 웹 기본 오브젝트 대응
15+
} else if (result.startsWith('/lib')) {
16+
// 신규 웹 기본 오브젝트 대응
1517
result = result.replace('/lib', '../../../node_modules');
16-
} else if (result.indexOf('temp') > -1) { // 일반 오브젝트 대응
18+
} else if (result.indexOf('temp') > -1) {
19+
// 일반 오브젝트 대응
1720
result = result.substring(result.indexOf('temp'));
18-
result = path.join(this.appPath, result)
19-
.replace(/\\/gi, '/');
21+
result = path.join(this.appPath, result).replace(/\\/gi, '/');
22+
} else if (result.match('/node_modules/@entrylabs/entry') !== null) {
23+
result = result.replace(
24+
'/node_modules/@entrylabs/entry',
25+
'../../../node_modules/entry-js'
26+
);
2027
}
21-
2228
// TODO: 히스토리 파악 후 완전 제거
2329
// if (fileUrl.endsWith('.svg')) {
2430
// // svg 파일의 경우 png 파일로 교체한다.
@@ -33,15 +39,16 @@ export default class {
3339

3440
if (result.startsWith('renderer')) {
3541
result = result.replace('renderer', '.');
42+
} else if (result.startsWith('../../../node_modules')) {
43+
// 웹 업로드시 bower 에서 받던 구조 그대로 사용할 것이므로, 그 사이에 혼동을 주지 않기 위해
44+
// node_modules 로 링크되는 구조를 과거 로직으로 재치환 하여 export 함
45+
result = result.replace('../../../node_modules', './bower_components');
46+
} else if (result.match('/node_modules/@entrylabs/entry') !== null) {
47+
result = result.replace('/node_modules/@entrylabs/entry', './bower_components');
3648
}
3749

38-
// 웹 업로드시 bower 에서 받던 구조 그대로 사용할 것이므로, 그 사이에 혼동을 주지 않기 위해
39-
// node_modules 로 링크되는 구조를 과거 로직으로 재치환 하여 export 함
40-
if (result.startsWith('../../../node_modules')) {
41-
result = result.replace('../../../node_modules','./bower_components');
42-
}
43-
44-
return result.substring(result.indexOf('temp'))
50+
return result
51+
.substring(result.indexOf('temp'))
4552
.replace(/\\/gi, '/')
4653
.replace(/.*\/\//, ''); // 외부 접속 프로토콜 스키마 보안 대응
4754
},
@@ -51,7 +58,7 @@ export default class {
5158
if (result.startsWith('renderer')) {
5259
result = result.replace('renderer', '.');
5360
} else if (result.startsWith('../../../node_modules')) {
54-
result = result.replace('../../../node_modules','./bower_components');
61+
result = result.replace('../../../node_modules', './bower_components');
5562
} else {
5663
result = undefined;
5764
}
@@ -105,87 +112,43 @@ export default class {
105112
}
106113

107114
static tempPathForExport(objectId: string) {
108-
return path.join(
109-
this.appPath,
110-
'import',
111-
objectId,
112-
path.sep,
113-
);
115+
return path.join(this.appPath, 'import', objectId, path.sep);
114116
}
115117

116118
// 사용위치는 join 을 사용 (프로젝트 외 경로)
117119
static get tempPath() {
118-
return path.join(
119-
this.appPath,
120-
'temp',
121-
path.sep,
122-
);
120+
return path.join(this.appPath, 'temp', path.sep);
123121
}
124122

125123
static tempImagePath(filename: string) {
126-
return path.join(
127-
this.tempPath,
128-
this.subDirectoryPath(filename),
129-
'image',
130-
path.sep,
131-
);
124+
return path.join(this.tempPath, this.subDirectoryPath(filename), 'image', path.sep);
132125
}
133126

134127
static tempThumbnailPath(filename: string) {
135-
return path.join(
136-
this.tempPath,
137-
this.subDirectoryPath(filename),
138-
'thumb',
139-
path.sep,
140-
);
128+
return path.join(this.tempPath, this.subDirectoryPath(filename), 'thumb', path.sep);
141129
}
142130

143131
static tempSoundPath(filename: string) {
144-
return path.join(
145-
this.tempPath,
146-
this.subDirectoryPath(filename),
147-
'sound',
148-
path.sep,
149-
);
132+
return path.join(this.tempPath, this.subDirectoryPath(filename), 'sound', path.sep);
150133
}
151134

152135
static get resourcePath() {
153-
return path.resolve(
154-
app.getAppPath(), 'src', 'renderer', 'resources', 'uploads',
155-
);
136+
return path.resolve(app.getAppPath(), 'src', 'renderer', 'resources', 'uploads');
156137
}
157138

158139
static resourceImagePath(filename: string) {
159-
return path.join(
160-
this.resourcePath,
161-
this.subDirectoryPath(filename),
162-
'image',
163-
path.sep,
164-
);
140+
return path.join(this.resourcePath, this.subDirectoryPath(filename), 'image', path.sep);
165141
}
166142

167143
static resourceThumbnailPath(filename: string) {
168-
return path.join(
169-
this.resourcePath,
170-
this.subDirectoryPath(filename),
171-
'thumb',
172-
path.sep,
173-
);
144+
return path.join(this.resourcePath, this.subDirectoryPath(filename), 'thumb', path.sep);
174145
}
175146

176147
static resourceSoundPath(filename: string) {
177-
return path.join(
178-
this.resourcePath,
179-
this.subDirectoryPath(filename),
180-
path.sep,
181-
);
148+
return path.join(this.resourcePath, this.subDirectoryPath(filename), path.sep);
182149
}
183150

184151
static subDirectoryPath(filename: string) {
185-
return path.join(
186-
filename.substr(0, 2),
187-
filename.substr(2, 2),
188-
path.sep,
189-
);
152+
return path.join(filename.substr(0, 2), filename.substr(2, 2), path.sep);
190153
}
191154
}

src/main/fileUtils.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@ import tar, { CreateOptions, FileOptions } from 'tar';
66
import { nativeImage, NativeImage } from 'electron';
77
import createLogger from './utils/functions/createLogger';
88
import ffmpeg from 'fluent-ffmpeg';
9-
import ffmpegInstaller from '@ffmpeg-installer/ffmpeg'
10-
import ffprobeInstaller from '@ffprobe-installer/ffprobe'
9+
import ffmpegInstaller from '@ffmpeg-installer/ffmpeg';
10+
import ffprobeInstaller from '@ffprobe-installer/ffprobe';
1111
import get from 'lodash/get';
1212

1313
type tarCreateOption = FileOptions & CreateOptions;
1414
type readFileOption = { encoding?: string | null; flag?: string } | string | undefined | null;
1515
type Dimension = { width: number; height: number };
1616

1717
const logger = createLogger('main/fileUtils.ts');
18-
const ffmpegPath = ffmpegInstaller.path.replace(
19-
'app.asar',
20-
'app.asar.unpacked'
21-
);
22-
const ffprobePath = ffprobeInstaller.path.replace(
23-
'app.asar',
24-
'app.asar.unpacked'
25-
);
18+
const ffmpegPath = ffmpegInstaller.path.replace('app.asar', 'app.asar.unpacked');
19+
const ffprobePath = ffprobeInstaller.path.replace('app.asar', 'app.asar.unpacked');
2620
ffmpeg.setFfmpegPath(ffmpegPath);
2721
ffmpeg.setFfprobePath(ffprobePath);
2822

src/main/mainUtils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default class MainUtils {
3333
const workingDirectoryPath = path.join(baseAppPath, 'temp');
3434
const tempDirectoryPath = path.join(baseAppPath, 'uploads', CommonUtils.createFileId());
3535
await FileUtils.mkdirRecursive(tempDirectoryPath);
36-
await FileUtils.unpack(filePath, tempDirectoryPath, (path) => path.startsWith('temp/'));
36+
await FileUtils.unpack(filePath, tempDirectoryPath);
3737

3838
const projectBuffer = await fsp.readFile(
3939
path.resolve(tempDirectoryPath, 'temp', 'project.json')
@@ -105,6 +105,10 @@ export default class MainUtils {
105105
return;
106106
}
107107
picture.fileurl = replaceStrategy(fileUrl);
108+
const thumbUrl = picture.thumbUrl;
109+
if (thumbUrl) {
110+
picture.thumbUrl = replaceStrategy(thumbUrl);
111+
}
108112
});
109113
sounds.forEach((sound: any) => {
110114
const fileUrl = sound.fileurl;

0 commit comments

Comments
 (0)