13 Commits
1.1.0 ... 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
Book Pauk
1a2cad315f Merge branch 'release/1.1.2' 2022-11-01 02:13:43 +07:00
Book Pauk
1d22a129e5 Версия 1.1.2 2022-11-01 02:12:55 +07:00
Book Pauk
2fd18a93e5 Поправлен баг по клику на имени автора 2022-11-01 02:11:30 +07:00
Book Pauk
511f20e9bc Merge tag '1.1.1' into develop
1.1.1
2022-11-01 02:03:24 +07:00
Book Pauk
a7af7342b6 Merge branch 'release/1.1.1' 2022-11-01 02:03:20 +07:00
Book Pauk
2fa8be9cb0 Версия 1.1.1 2022-11-01 02:02:59 +07:00
Book Pauk
9f67b3bf28 Улучшение обработки ошибок в gzipFile 2022-11-01 02:01:15 +07:00
Book Pauk
037d1aa022 Исправления багов скачивания файла в режиме RemoteLib 2022-11-01 01:53:39 +07:00
Book Pauk
b56eeaa024 Merge tag '1.1.0' into develop
1.1.0
2022-11-01 01:11:44 +07:00
7 changed files with 26 additions and 40 deletions

View File

@@ -30,34 +30,10 @@
</q-icon> </q-icon>
</div> </div>
</div> </div>
<!--div v-if="!titleList" class="q-ml-sm row items-center">
{{ book.serno ? `${book.serno}. ` : '' }}
<div v-if="showAuthor && book.author">
<span class="clickable2 text-green-10" @click="selectAuthor">{{ bookAuthor }}</span>
&nbsp;-&nbsp;
<span class="clickable2" :class="titleColor" @click="selectTitle">{{ book.title }}</span>
</div>
<span v-else class="clickable2" :class="titleColor" @click="selectTitle">{{ book.title }}</span>
</div>
<div v-else class="q-ml-sm row items-center">
<span class="clickable2" :class="titleColor" @click="selectTitle">{{ book.title }}</span>
<div v-if="book.author || bookSeries" class="row">
&nbsp;-&nbsp;
<div v-if="book.author">
<span class="clickable2 text-green-10" @click="selectAuthor">{{ bookAuthor }}</span>
&nbsp;
</div>
<div v-if="bookSeries">
<span class="clickable2" @click="selectSeries">{{ bookSeries }}</span>
</div>
</div>
</div-->
</div> </div>
<div class="q-ml-sm column"> <div class="q-ml-sm column">
<div v-if="(mode == 'series' || mode == 'title') && bookAuthor" class="row items-center clickable2 text-green-10"> <div v-if="(mode == 'series' || mode == 'title') && bookAuthor" class="row items-center clickable2 text-green-10" @click="selectAuthor">
{{ bookAuthor }} {{ bookAuthor }}
</div> </div>

4
package-lock.json generated
View File

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

View File

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

View File

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

View File

@@ -65,7 +65,7 @@ class RemoteLib {
const buf = await this.down.load(`${this.remoteHost}${link}`, {decompress: false}); const buf = await this.down.load(`${this.remoteHost}${link}`, {decompress: false});
const publicPath = `${this.config.publicDir}${link}`; const publicPath = `${this.config.publicFilesDir}${link}`;
await fs.writeFile(publicPath, buf); await fs.writeFile(publicPath, buf);

View File

@@ -370,12 +370,14 @@ class WebWorker {
const bookFileDesc = `${bookFile}.json`; const bookFileDesc = `${bookFile}.json`;
if (!await fs.pathExists(bookFile) || !await fs.pathExists(bookFileDesc)) { if (!await fs.pathExists(bookFile) || !await fs.pathExists(bookFileDesc)) {
await fs.ensureDir(path.dirname(bookFile)); if (!await fs.pathExists(bookFile) && extractedFile) {
const tmpFile = `${this.config.tempDir}/${utils.randomHexString(30)}`;
const tmpFile = `${this.config.tempDir}/${utils.randomHexString(30)}`; await utils.gzipFile(extractedFile, tmpFile, 4);
await utils.gzipFile(extractedFile, tmpFile, 4); await fs.remove(extractedFile);
await fs.remove(extractedFile); await fs.move(tmpFile, bookFile, {overwrite: true});
await fs.move(tmpFile, bookFile, {overwrite: true}); } else {
await utils.touchFile(bookFile);
}
await fs.writeFile(bookFileDesc, JSON.stringify({bookPath, downFileName})); await fs.writeFile(bookFileDesc, JSON.stringify({bookPath, downFileName}));
} else { } else {
@@ -411,9 +413,10 @@ class WebWorker {
const rows = await db.select({table: 'file_hash', where: `@@id(${db.esc(bookPath)})`}); const rows = await db.select({table: 'file_hash', where: `@@id(${db.esc(bookPath)})`});
if (rows.length) {//хеш найден по bookPath if (rows.length) {//хеш найден по bookPath
const hash = rows[0].hash; const hash = rows[0].hash;
const bookFileDesc = `${this.config.filesDir}/${hash}.json`; const bookFile = `${this.config.filesDir}/${hash}`;
const bookFileDesc = `${bookFile}.json`;
if (await fs.pathExists(bookFileDesc)) { if (await fs.pathExists(bookFile) && await fs.pathExists(bookFileDesc)) {
link = `${this.config.filesPathStatic}/${hash}`; link = `${this.config.filesPathStatic}/${hash}`;
} }
} }

View File

@@ -105,7 +105,10 @@ function gzipFile(inputFile, outputFile, level = 1) {
const input = fs.createReadStream(inputFile); const input = fs.createReadStream(inputFile);
const output = fs.createWriteStream(outputFile); const output = fs.createWriteStream(outputFile);
input.pipe(gzip).pipe(output).on('finish', (err) => { input.on('error', reject)
.pipe(gzip).on('error', reject)
.pipe(output).on('error', reject)
.on('finish', (err) => {
if (err) reject(err); if (err) reject(err);
else resolve(); else resolve();
}); });