@quatrain/worker 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FileSystem.js +5 -5
- package/package.json +3 -3
- package/src/FileSystem.ts +7 -7
package/dist/FileSystem.js
CHANGED
|
@@ -90,7 +90,7 @@ class FileSystem {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
static safeString(name) {
|
|
93
|
-
return name.
|
|
93
|
+
return name.replaceAll(/\s+/g, '_');
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
96
|
* Upload file to public URL and return meta data
|
|
@@ -174,13 +174,13 @@ class FileSystem {
|
|
|
174
174
|
}
|
|
175
175
|
// Worker.debug(`ffprobe getInfo: ${JSON.stringify(metadata)}`)
|
|
176
176
|
const { width, height, duration, bit_rate: bitrate, nb_frames: nbFramees, } = metadata.streams[0];
|
|
177
|
-
const nb_frames = parseFloat(nbFramees);
|
|
178
|
-
const framerate = nb_frames / parseFloat(duration);
|
|
177
|
+
const nb_frames = Number.parseFloat(nbFramees);
|
|
178
|
+
const framerate = nb_frames / Number.parseFloat(duration);
|
|
179
179
|
resolve({
|
|
180
180
|
width,
|
|
181
181
|
height,
|
|
182
|
-
framerate: parseInt(framerate.toFixed(0)),
|
|
183
|
-
duration: parseInt(duration),
|
|
182
|
+
framerate: Number.parseInt(framerate.toFixed(0)),
|
|
183
|
+
duration: Number.parseInt(duration),
|
|
184
184
|
bitrate,
|
|
185
185
|
});
|
|
186
186
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/worker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Container Worker helpers",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@quatrain/core": "^1.2.5",
|
|
38
|
-
"@quatrain/queue": "^1.2.
|
|
39
|
-
"@quatrain/storage": "^1.2.
|
|
38
|
+
"@quatrain/queue": "^1.2.2",
|
|
39
|
+
"@quatrain/storage": "^1.2.3",
|
|
40
40
|
"axios": "^1.7.7",
|
|
41
41
|
"fluent-ffmpeg": "^2.1.2",
|
|
42
42
|
"fs-extra": "^11.2.0",
|
package/src/FileSystem.ts
CHANGED
|
@@ -59,7 +59,7 @@ export class FileSystem {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
static safeString(name: string) {
|
|
62
|
-
return name.
|
|
62
|
+
return name.replaceAll(/\s+/g, '_')
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/**
|
|
@@ -90,7 +90,7 @@ export class FileSystem {
|
|
|
90
90
|
'Content-Type': meta.contentType || mime,
|
|
91
91
|
'Content-length': String(size),
|
|
92
92
|
},
|
|
93
|
-
})
|
|
93
|
+
} as any)
|
|
94
94
|
.then(() => resolve({ ...meta, size, uploadUrl: undefined }))
|
|
95
95
|
.catch((err) => {
|
|
96
96
|
Worker.error(
|
|
@@ -134,7 +134,7 @@ export class FileSystem {
|
|
|
134
134
|
'Content-Type': meta.contentType || mime,
|
|
135
135
|
'Content-length': String(size),
|
|
136
136
|
},
|
|
137
|
-
})
|
|
137
|
+
} as any)
|
|
138
138
|
.then(() => resolve({ ...meta, size, uploadUrl: undefined }))
|
|
139
139
|
.catch((err) => {
|
|
140
140
|
Worker.error(
|
|
@@ -168,13 +168,13 @@ export class FileSystem {
|
|
|
168
168
|
bit_rate: bitrate,
|
|
169
169
|
nb_frames: nbFramees,
|
|
170
170
|
} = metadata.streams[0]
|
|
171
|
-
const nb_frames: number = parseFloat(nbFramees as string)
|
|
172
|
-
const framerate = nb_frames / parseFloat(duration as string)
|
|
171
|
+
const nb_frames: number = Number.parseFloat(nbFramees as string)
|
|
172
|
+
const framerate = nb_frames / Number.parseFloat(duration as string)
|
|
173
173
|
resolve({
|
|
174
174
|
width,
|
|
175
175
|
height,
|
|
176
|
-
framerate: parseInt(framerate.toFixed(0)),
|
|
177
|
-
duration: parseInt(duration as string),
|
|
176
|
+
framerate: Number.parseInt(framerate.toFixed(0)),
|
|
177
|
+
duration: Number.parseInt(duration as string),
|
|
178
178
|
bitrate,
|
|
179
179
|
})
|
|
180
180
|
})
|