diff --git a/build/linux.js b/build/linux.js index ac14b5e8..5abdf1bf 100644 --- a/build/linux.js +++ b/build/linux.js @@ -23,24 +23,6 @@ async function main() { await fs.ensureDir(tempDownloadDir); - //sqlite3 - const sqliteRemoteUrl = 'https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-linux-x64.tar.gz'; - const sqliteDecompressedFilename = `${tempDownloadDir}/napi-v3-linux-x64/node_sqlite3.node`; - - if (!await fs.pathExists(sqliteDecompressedFilename)) { - // Скачиваем node_sqlite3.node для винды, т.к. pkg не включает его в сборку - const res = await axios.get(sqliteRemoteUrl, {responseType: 'stream'}) - await pipeline(res.data, fs.createWriteStream(`${tempDownloadDir}/sqlite.tar.gz`)); - console.log(`done downloading ${sqliteRemoteUrl}`); - - //распаковываем - console.log(await decomp.unpackTarZZ(`${tempDownloadDir}/sqlite.tar.gz`, tempDownloadDir)); - console.log('files decompressed'); - } - // копируем в дистрибутив - await fs.copy(sqliteDecompressedFilename, `${outDir}/node_sqlite3.node`); - console.log(`copied ${sqliteDecompressedFilename} to ${outDir}/node_sqlite3.node`); - //ipfs const ipfsDecompressedFilename = `${tempDownloadDir}/go-ipfs/ipfs`; if (!await fs.pathExists(ipfsDecompressedFilename)) { diff --git a/build/win.js b/build/win.js index 9a9fa835..016e236b 100644 --- a/build/win.js +++ b/build/win.js @@ -23,24 +23,6 @@ async function main() { await fs.ensureDir(tempDownloadDir); - //sqlite3 - const sqliteRemoteUrl = 'https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.2/napi-v3-win32-x64.tar.gz'; - const sqliteDecompressedFilename = `${tempDownloadDir}/napi-v3-win32-x64/node_sqlite3.node`; - - if (!await fs.pathExists(sqliteDecompressedFilename)) { - // Скачиваем node_sqlite3.node для винды, т.к. pkg не включает его в сборку - const res = await axios.get(sqliteRemoteUrl, {responseType: 'stream'}) - await pipeline(res.data, fs.createWriteStream(`${tempDownloadDir}/sqlite.tar.gz`)); - console.log(`done downloading ${sqliteRemoteUrl}`); - - //распаковываем - console.log(await decomp.unpackTarZZ(`${tempDownloadDir}/sqlite.tar.gz`, tempDownloadDir)); - console.log('files decompressed'); - } - // копируем в дистрибутив - await fs.copy(sqliteDecompressedFilename, `${outDir}/node_sqlite3.node`); - console.log(`copied ${sqliteDecompressedFilename} to ${outDir}/node_sqlite3.node`); - //ipfs const ipfsDecompressedFilename = `${tempDownloadDir}/go-ipfs/ipfs.exe`; if (!await fs.pathExists(ipfsDecompressedFilename)) { diff --git a/client/api/misc.js b/client/api/misc.js index 16b7a368..141fd3cf 100644 --- a/client/api/misc.js +++ b/client/api/misc.js @@ -9,7 +9,7 @@ class Misc { async loadConfig() { const query = {params: [ - 'name', 'version', 'mode', 'maxUploadFileSize', 'useExternalBookConverter', 'acceptFileExt', 'branch', + 'name', 'version', 'mode', 'maxUploadFileSize', 'useExternalBookConverter', 'acceptFileExt', 'bucEnabled', 'branch', ]}; try { diff --git a/client/api/reader.js b/client/api/reader.js index d0f97622..1cf1339e 100644 --- a/client/api/reader.js +++ b/client/api/reader.js @@ -229,6 +229,17 @@ class Reader { return (await axios.get(url)).data; } + async checkBuc(bookUrls) { + const response = await wsc.message(await wsc.send({action: 'check-buc', bookUrls})); + + if (response.error) + throw new Error(response.error); + + if (!response.data) + throw new Error(`response.data is empty`); + + return response.data; + } } export default new Reader(); \ No newline at end of file diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index c1c824b4..69e43a4d 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -100,6 +100,12 @@