Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a2cad315f | ||
|
|
1d22a129e5 | ||
|
|
2fd18a93e5 | ||
|
|
511f20e9bc | ||
|
|
a7af7342b6 | ||
|
|
2fa8be9cb0 | ||
|
|
9f67b3bf28 | ||
|
|
037d1aa022 | ||
|
|
b56eeaa024 |
@@ -30,34 +30,10 @@
|
||||
</q-icon>
|
||||
</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>
|
||||
-
|
||||
<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">
|
||||
-
|
||||
<div v-if="book.author">
|
||||
<span class="clickable2 text-green-10" @click="selectAuthor">{{ bookAuthor }}</span>
|
||||
|
||||
</div>
|
||||
<div v-if="bookSeries">
|
||||
<span class="clickable2" @click="selectSeries">{{ bookSeries }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div-->
|
||||
</div>
|
||||
|
||||
<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 }}
|
||||
</div>
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "inpx-web",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "inpx-web",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.2",
|
||||
"hasInstallScript": true,
|
||||
"license": "CC0-1.0",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "inpx-web",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.2",
|
||||
"author": "Book Pauk <bookpauk@gmail.com>",
|
||||
"license": "CC0-1.0",
|
||||
"repository": "bookpauk/inpx-web",
|
||||
|
||||
@@ -65,7 +65,7 @@ class RemoteLib {
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -370,12 +370,14 @@ class WebWorker {
|
||||
const bookFileDesc = `${bookFile}.json`;
|
||||
|
||||
if (!await fs.pathExists(bookFile) || !await fs.pathExists(bookFileDesc)) {
|
||||
await fs.ensureDir(path.dirname(bookFile));
|
||||
|
||||
const tmpFile = `${this.config.tempDir}/${utils.randomHexString(30)}`;
|
||||
await utils.gzipFile(extractedFile, tmpFile, 4);
|
||||
await fs.remove(extractedFile);
|
||||
await fs.move(tmpFile, bookFile, {overwrite: true});
|
||||
if (!await fs.pathExists(bookFile) && extractedFile) {
|
||||
const tmpFile = `${this.config.tempDir}/${utils.randomHexString(30)}`;
|
||||
await utils.gzipFile(extractedFile, tmpFile, 4);
|
||||
await fs.remove(extractedFile);
|
||||
await fs.move(tmpFile, bookFile, {overwrite: true});
|
||||
} else {
|
||||
await utils.touchFile(bookFile);
|
||||
}
|
||||
|
||||
await fs.writeFile(bookFileDesc, JSON.stringify({bookPath, downFileName}));
|
||||
} else {
|
||||
@@ -411,9 +413,10 @@ class WebWorker {
|
||||
const rows = await db.select({table: 'file_hash', where: `@@id(${db.esc(bookPath)})`});
|
||||
if (rows.length) {//хеш найден по bookPath
|
||||
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}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,10 @@ function gzipFile(inputFile, outputFile, level = 1) {
|
||||
const input = fs.createReadStream(inputFile);
|
||||
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);
|
||||
else resolve();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user