4 Commits
1.1.2 ... 1.1.3

Author SHA1 Message Date
Book Pauk
cd35acb60e Merge branch 'release/1.1.3' 2022-11-03 21:27:08 +07:00
Book Pauk
94bec6ed42 Верия 1.1.3 2022-11-03 21:26:45 +07:00
Book Pauk
42436fabd3 Исправлен баг "Не качает книги #1", fixed #1 2022-11-03 21:25:10 +07:00
Book Pauk
36c50fd699 Merge tag '1.1.2' into develop
1.1.2
2022-11-01 02:13:49 +07:00
3 changed files with 9 additions and 5 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "inpx-web",
"version": "1.1.2",
"version": "1.1.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "inpx-web",
"version": "1.1.2",
"version": "1.1.3",
"hasInstallScript": true,
"license": "CC0-1.0",
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "inpx-web",
"version": "1.1.2",
"version": "1.1.3",
"author": "Book Pauk <bookpauk@gmail.com>",
"license": "CC0-1.0",
"repository": "bookpauk/inpx-web",

View File

@@ -72,7 +72,7 @@ class InpxParser {
await readFileCallback({fileName: inpFile, current: ++current});
const buf = await zipReader.extractToBuf(inpFile);
await this.parseInp(buf, structure, parsedCallback);
await this.parseInp(buf, structure, inpFile, parsedCallback);
}
if (this.chunk.length) {
@@ -84,9 +84,10 @@ class InpxParser {
}
}
async parseInp(inpBuf, structure, parsedCallback) {
async parseInp(inpBuf, structure, inpFile, parsedCallback) {
const structLen = structure.length;
const rows = inpBuf.toString().split('\n');
const defaultFolder = `${path.basename(inpFile, '.inp')}.zip`;
for (const row of rows) {
let line = row;
@@ -115,6 +116,9 @@ class InpxParser {
rec.genre = rec.genre.split(':').filter(s => s).join(',');
}
if (!rec.folder)
rec.folder = defaultFolder;
rec.serno = parseInt(rec.serno, 10) || 0;
rec.size = parseInt(rec.size, 10) || 0;
rec.del = parseInt(rec.del, 10) || 0;