From 158118d183711739e497f60d307c07550163d559 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Mon, 21 Oct 2019 21:36:43 +0700 Subject: [PATCH 1/5] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/Reader.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 0dd472b3..76b62b19 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -543,6 +543,7 @@ class Reader extends Vue { if (value) { await utils.sleep(500); while (!this.$refs.serverStorage.inited) await utils.sleep(100); + while (!bookManager.loaded) await utils.sleep(100); this.$refs.serverStorage.saveRecent(value); } From b0e7431e72e22a209f1494e2cb2597b7968f14c2 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Mon, 21 Oct 2019 22:03:00 +0700 Subject: [PATCH 2/5] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D1=81=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/Reader.vue | 8 +- .../Reader/ServerStorage/ServerStorage.vue | 98 +++++++++---------- 2 files changed, 54 insertions(+), 52 deletions(-) diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 76b62b19..1ff1de07 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -542,10 +542,12 @@ class Reader extends Vue { if (value) { await utils.sleep(500); - while (!this.$refs.serverStorage.inited) await utils.sleep(100); - while (!bookManager.loaded) await utils.sleep(100); + while (!this.$refs.serverStorage.inited || + !bookManager.loaded || + this.$refs.serverStorage.savingRecent) + await utils.sleep(100); - this.$refs.serverStorage.saveRecent(value); + await this.$refs.serverStorage.saveRecent(value); } } } diff --git a/client/components/Reader/ServerStorage/ServerStorage.vue b/client/components/Reader/ServerStorage/ServerStorage.vue index 41db5989..040d2ca2 100644 --- a/client/components/Reader/ServerStorage/ServerStorage.vue +++ b/client/components/Reader/ServerStorage/ServerStorage.vue @@ -435,64 +435,64 @@ class ServerStorage extends Vue { if (!this.keyInited || !this.serverSyncEnabled || this.savingRecent) return; - const bm = bookManager; + this.savingRecent = true; + try { + const bm = bookManager; - let needSaveRecent = false; - let needSaveRecentPatch = false; - let needSaveRecentMod = false; + let needSaveRecent = false; + let needSaveRecentPatch = false; + let needSaveRecentMod = false; - //newRecentMod - let newRecentMod = {}; - if (itemKey && this.cachedRecentPatch.data[itemKey] && this.prevItemKey == itemKey) { - newRecentMod = _.cloneDeep(this.cachedRecentMod); - newRecentMod.rev++; + //newRecentMod + let newRecentMod = {}; + if (itemKey && this.cachedRecentPatch.data[itemKey] && this.prevItemKey == itemKey) { + newRecentMod = _.cloneDeep(this.cachedRecentMod); + newRecentMod.rev++; - newRecentMod.data.key = itemKey; - newRecentMod.data.mod = utils.getObjDiff(this.cachedRecentPatch.data[itemKey], bm.recent[itemKey]); - needSaveRecentMod = true; - } - this.prevItemKey = itemKey; + newRecentMod.data.key = itemKey; + newRecentMod.data.mod = utils.getObjDiff(this.cachedRecentPatch.data[itemKey], bm.recent[itemKey]); + needSaveRecentMod = true; + } + this.prevItemKey = itemKey; - //newRecentPatch - let newRecentPatch = {}; - if (itemKey && !needSaveRecentMod) { - newRecentPatch = _.cloneDeep(this.cachedRecentPatch); - newRecentPatch.rev++; - newRecentPatch.data[itemKey] = bm.recent[itemKey]; + //newRecentPatch + let newRecentPatch = {}; + if (itemKey && !needSaveRecentMod) { + newRecentPatch = _.cloneDeep(this.cachedRecentPatch); + newRecentPatch.rev++; + newRecentPatch.data[itemKey] = bm.recent[itemKey]; - let applyMod = this.cachedRecentMod.data; - if (applyMod && applyMod.key && newRecentPatch.data[applyMod.key]) - newRecentPatch.data[applyMod.key] = utils.applyObjDiff(newRecentPatch.data[applyMod.key], applyMod.mod); + let applyMod = this.cachedRecentMod.data; + if (applyMod && applyMod.key && newRecentPatch.data[applyMod.key]) + newRecentPatch.data[applyMod.key] = utils.applyObjDiff(newRecentPatch.data[applyMod.key], applyMod.mod); - newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}}; - needSaveRecentPatch = true; - needSaveRecentMod = true; - } + newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}}; + needSaveRecentPatch = true; + needSaveRecentMod = true; + } - //newRecent - let newRecent = {}; - if (!itemKey || (needSaveRecentPatch && Object.keys(newRecentPatch.data).length > 10)) { - newRecent = {rev: this.cachedRecent.rev + 1, data: bm.recent}; - newRecentPatch = {rev: this.cachedRecentPatch.rev + 1, data: {}}; - newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}}; - needSaveRecent = true; - needSaveRecentPatch = true; - needSaveRecentMod = true; - } + //newRecent + let newRecent = {}; + if (!itemKey || (needSaveRecentPatch && Object.keys(newRecentPatch.data).length > 10)) { + newRecent = {rev: this.cachedRecent.rev + 1, data: bm.recent}; + newRecentPatch = {rev: this.cachedRecentPatch.rev + 1, data: {}}; + newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}}; + needSaveRecent = true; + needSaveRecentPatch = true; + needSaveRecentMod = true; + } - //query - let query = {}; - if (needSaveRecent) { - query = {recent: newRecent, recentPatch: newRecentPatch, recentMod: newRecentMod}; - } else if (needSaveRecentPatch) { - query = {recentPatch: newRecentPatch, recentMod: newRecentMod}; - } else { - query = {recentMod: newRecentMod}; - } + //query + let query = {}; + if (needSaveRecent) { + query = {recent: newRecent, recentPatch: newRecentPatch, recentMod: newRecentMod}; + } else if (needSaveRecentPatch) { + query = {recentPatch: newRecentPatch, recentMod: newRecentMod}; + } else { + query = {recentMod: newRecentMod}; + } - //сохранение - this.savingRecent = true; - try { + //сохранение let result = {state: ''}; try { From 309a9ad4fb11a28213c4efddadf183aa925181b3 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Tue, 22 Oct 2019 15:41:14 +0700 Subject: [PATCH 3/5] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/Reader.vue | 6 +----- client/components/Reader/ServerStorage/ServerStorage.vue | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 1ff1de07..fc37ac4b 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -540,13 +540,9 @@ class Reader extends Vue { await this.$refs.recentBooksPage.updateTableData(); } + //сохранение в serverStorage if (value) { await utils.sleep(500); - while (!this.$refs.serverStorage.inited || - !bookManager.loaded || - this.$refs.serverStorage.savingRecent) - await utils.sleep(100); - await this.$refs.serverStorage.saveRecent(value); } } diff --git a/client/components/Reader/ServerStorage/ServerStorage.vue b/client/components/Reader/ServerStorage/ServerStorage.vue index 040d2ca2..4064314a 100644 --- a/client/components/Reader/ServerStorage/ServerStorage.vue +++ b/client/components/Reader/ServerStorage/ServerStorage.vue @@ -432,6 +432,9 @@ class ServerStorage extends Vue { } async saveRecent(itemKey, recurse) { + while (!this.inited || this.savingRecent) + await utils.sleep(100); + if (!this.keyInited || !this.serverSyncEnabled || this.savingRecent) return; @@ -474,6 +477,10 @@ class ServerStorage extends Vue { //newRecent let newRecent = {}; if (!itemKey || (needSaveRecentPatch && Object.keys(newRecentPatch.data).length > 10)) { + //ждем весь bm.recent + while (!bookManager.loaded) + await utils.sleep(100); + newRecent = {rev: this.cachedRecent.rev + 1, data: bm.recent}; newRecentPatch = {rev: this.cachedRecentPatch.rev + 1, data: {}}; newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}}; From 4f433b4456d8bd8bf02ed38014e6cffe19072f33 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Tue, 22 Oct 2019 17:56:17 +0700 Subject: [PATCH 4/5] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/omnireader/old/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/omnireader/old/index.html b/docs/omnireader/old/index.html index 55ad69b9..116dbd60 100644 --- a/docs/omnireader/old/index.html +++ b/docs/omnireader/old/index.html @@ -153,7 +153,7 @@

-

URL html- , - (, " fb2"). - : html, txt, fb2, fb2.zip + : fb2, html, txt, rtf, doc, docx, pdf, epub, mobi : zip, bz2, gz

, :

javascript:location.href='http://old.omnireader.ru/?url='+location.href; From fdaa3b7f93c87ce1b5770d74627986d72e723029 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Tue, 22 Oct 2019 17:58:20 +0700 Subject: [PATCH 5/5] =?UTF-8?q?=D0=92=D0=B5=D1=80=D1=81=D0=B8=D1=8F=200.7.?= =?UTF-8?q?5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/versionHistory.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/components/Reader/versionHistory.js b/client/components/Reader/versionHistory.js index 3a30ee2f..0ce414b2 100644 --- a/client/components/Reader/versionHistory.js +++ b/client/components/Reader/versionHistory.js @@ -1,7 +1,7 @@ export const versionHistory = [ { - showUntil: '2019-10-20', - header: '0.7.4 (2019-10-21)', + showUntil: '2019-10-21', + header: '0.7.5 (2019-10-22)', content: `

    diff --git a/package.json b/package.json index 422a64a2..8a4d7311 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Liberama", - "version": "0.7.4", + "version": "0.7.5", "engines": { "node": ">=10.0.0" },