Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab46a1b99d | ||
|
|
4a08465f5b | ||
|
|
a7960d6cd6 | ||
|
|
3caea77dde | ||
|
|
fdaa3b7f93 | ||
|
|
4f433b4456 | ||
|
|
309a9ad4fb | ||
|
|
b0e7431e72 | ||
|
|
158118d183 | ||
|
|
382e37fc5a |
@@ -540,11 +540,10 @@ class Reader extends Vue {
|
|||||||
await this.$refs.recentBooksPage.updateTableData();
|
await this.$refs.recentBooksPage.updateTableData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//сохранение в serverStorage
|
||||||
if (value) {
|
if (value) {
|
||||||
await utils.sleep(500);
|
await utils.sleep(500);
|
||||||
while (!this.$refs.serverStorage.inited) await utils.sleep(100);
|
await this.$refs.serverStorage.saveRecent(value);
|
||||||
|
|
||||||
this.$refs.serverStorage.saveRecent(value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -405,6 +405,11 @@ class ServerStorage extends Vue {
|
|||||||
if (md.key && result[md.key])
|
if (md.key && result[md.key])
|
||||||
result[md.key] = utils.applyObjDiff(result[md.key], md.mod);
|
result[md.key] = utils.applyObjDiff(result[md.key], md.mod);
|
||||||
|
|
||||||
|
if (!bookManager.loaded) {
|
||||||
|
this.warning('Ожидание загрузки списка книг перед синхронизацией');
|
||||||
|
while (!bookManager.loaded) await utils.sleep(100);
|
||||||
|
}
|
||||||
|
|
||||||
if (newRecent.rev != this.cachedRecent.rev)
|
if (newRecent.rev != this.cachedRecent.rev)
|
||||||
await this.setCachedRecent(newRecent);
|
await this.setCachedRecent(newRecent);
|
||||||
if (newRecentPatch.rev != this.cachedRecentPatch.rev)
|
if (newRecentPatch.rev != this.cachedRecentPatch.rev)
|
||||||
@@ -412,11 +417,6 @@ class ServerStorage extends Vue {
|
|||||||
if (newRecentMod.rev != this.cachedRecentMod.rev)
|
if (newRecentMod.rev != this.cachedRecentMod.rev)
|
||||||
await this.setCachedRecentMod(newRecentMod);
|
await this.setCachedRecentMod(newRecentMod);
|
||||||
|
|
||||||
if (!bookManager.loaded) {
|
|
||||||
this.warning('Ожидание загрузки списка книг перед синхронизацией');
|
|
||||||
while (!bookManager.loaded) await utils.sleep(100);
|
|
||||||
}
|
|
||||||
|
|
||||||
await bookManager.setRecent(result);
|
await bookManager.setRecent(result);
|
||||||
} else {
|
} else {
|
||||||
this.warning(`Неверный ответ сервера: ${recent.state}`);
|
this.warning(`Неверный ответ сервера: ${recent.state}`);
|
||||||
@@ -432,67 +432,74 @@ class ServerStorage extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async saveRecent(itemKey, recurse) {
|
async saveRecent(itemKey, recurse) {
|
||||||
|
while (!this.inited || this.savingRecent)
|
||||||
|
await utils.sleep(100);
|
||||||
|
|
||||||
if (!this.keyInited || !this.serverSyncEnabled || this.savingRecent)
|
if (!this.keyInited || !this.serverSyncEnabled || this.savingRecent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const bm = bookManager;
|
this.savingRecent = true;
|
||||||
|
try {
|
||||||
|
const bm = bookManager;
|
||||||
|
|
||||||
let needSaveRecent = false;
|
let needSaveRecent = false;
|
||||||
let needSaveRecentPatch = false;
|
let needSaveRecentPatch = false;
|
||||||
let needSaveRecentMod = false;
|
let needSaveRecentMod = false;
|
||||||
|
|
||||||
//newRecentMod
|
//newRecentMod
|
||||||
let newRecentMod = {};
|
let newRecentMod = {};
|
||||||
if (itemKey && this.cachedRecentPatch.data[itemKey] && this.prevItemKey == itemKey) {
|
if (itemKey && this.cachedRecentPatch.data[itemKey] && this.prevItemKey == itemKey) {
|
||||||
newRecentMod = _.cloneDeep(this.cachedRecentMod);
|
newRecentMod = _.cloneDeep(this.cachedRecentMod);
|
||||||
newRecentMod.rev++;
|
newRecentMod.rev++;
|
||||||
|
|
||||||
newRecentMod.data.key = itemKey;
|
newRecentMod.data.key = itemKey;
|
||||||
newRecentMod.data.mod = utils.getObjDiff(this.cachedRecentPatch.data[itemKey], bm.recent[itemKey]);
|
newRecentMod.data.mod = utils.getObjDiff(this.cachedRecentPatch.data[itemKey], bm.recent[itemKey]);
|
||||||
needSaveRecentMod = true;
|
needSaveRecentMod = true;
|
||||||
}
|
}
|
||||||
this.prevItemKey = itemKey;
|
this.prevItemKey = itemKey;
|
||||||
|
|
||||||
//newRecentPatch
|
//newRecentPatch
|
||||||
let newRecentPatch = {};
|
let newRecentPatch = {};
|
||||||
if (itemKey && !needSaveRecentMod) {
|
if (itemKey && !needSaveRecentMod) {
|
||||||
newRecentPatch = _.cloneDeep(this.cachedRecentPatch);
|
newRecentPatch = _.cloneDeep(this.cachedRecentPatch);
|
||||||
newRecentPatch.rev++;
|
newRecentPatch.rev++;
|
||||||
newRecentPatch.data[itemKey] = bm.recent[itemKey];
|
newRecentPatch.data[itemKey] = bm.recent[itemKey];
|
||||||
|
|
||||||
let applyMod = this.cachedRecentMod.data;
|
let applyMod = this.cachedRecentMod.data;
|
||||||
if (applyMod && applyMod.key && newRecentPatch.data[applyMod.key])
|
if (applyMod && applyMod.key && newRecentPatch.data[applyMod.key])
|
||||||
newRecentPatch.data[applyMod.key] = utils.applyObjDiff(newRecentPatch.data[applyMod.key], applyMod.mod);
|
newRecentPatch.data[applyMod.key] = utils.applyObjDiff(newRecentPatch.data[applyMod.key], applyMod.mod);
|
||||||
|
|
||||||
newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}};
|
newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}};
|
||||||
needSaveRecentPatch = true;
|
needSaveRecentPatch = true;
|
||||||
needSaveRecentMod = true;
|
needSaveRecentMod = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//newRecent
|
//newRecent
|
||||||
let newRecent = {};
|
let newRecent = {};
|
||||||
if (!itemKey || (needSaveRecentPatch && Object.keys(newRecentPatch.data).length > 10)) {
|
if (!itemKey || (needSaveRecentPatch && Object.keys(newRecentPatch.data).length > 10)) {
|
||||||
newRecent = {rev: this.cachedRecent.rev + 1, data: bm.recent};
|
//ждем весь bm.recent
|
||||||
newRecentPatch = {rev: this.cachedRecentPatch.rev + 1, data: {}};
|
while (!bookManager.loaded)
|
||||||
newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}};
|
await utils.sleep(100);
|
||||||
needSaveRecent = true;
|
|
||||||
needSaveRecentPatch = true;
|
|
||||||
needSaveRecentMod = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//query
|
newRecent = {rev: this.cachedRecent.rev + 1, data: bm.recent};
|
||||||
let query = {};
|
newRecentPatch = {rev: this.cachedRecentPatch.rev + 1, data: {}};
|
||||||
if (needSaveRecent) {
|
newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}};
|
||||||
query = {recent: newRecent, recentPatch: newRecentPatch, recentMod: newRecentMod};
|
needSaveRecent = true;
|
||||||
} else if (needSaveRecentPatch) {
|
needSaveRecentPatch = true;
|
||||||
query = {recentPatch: newRecentPatch, recentMod: newRecentMod};
|
needSaveRecentMod = true;
|
||||||
} else {
|
}
|
||||||
query = {recentMod: newRecentMod};
|
|
||||||
}
|
|
||||||
|
|
||||||
//сохранение
|
//query
|
||||||
this.savingRecent = true;
|
let query = {};
|
||||||
try {
|
if (needSaveRecent) {
|
||||||
|
query = {recent: newRecent, recentPatch: newRecentPatch, recentMod: newRecentMod};
|
||||||
|
} else if (needSaveRecentPatch) {
|
||||||
|
query = {recentPatch: newRecentPatch, recentMod: newRecentMod};
|
||||||
|
} else {
|
||||||
|
query = {recentMod: newRecentMod};
|
||||||
|
}
|
||||||
|
|
||||||
|
//сохранение
|
||||||
let result = {state: ''};
|
let result = {state: ''};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export const versionHistory = [
|
export const versionHistory = [
|
||||||
{
|
{
|
||||||
showUntil: '2019-10-20',
|
showUntil: '2019-10-21',
|
||||||
header: '0.7.4 (2019-10-21)',
|
header: '0.7.5 (2019-10-22)',
|
||||||
content:
|
content:
|
||||||
`
|
`
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
<p>- ðåãèñòðàöèÿ íå òðåáóåòñÿ
|
<p>- ðåãèñòðàöèÿ íå òðåáóåòñÿ
|
||||||
|
|
||||||
<br><br> êà÷åñòâå URL ìîæíî çàäàâàòü html-ñòðàíè÷êó ñ êíèãîé, ëèáî ïðÿìóþ ññûëêó íà ôàéë èç îíëàéí-áèáëèîòåêè (íàïðèìåð, ñêîïèðîâàâ àäðåñ ññûëêè èëè êíîïêè "ñêà÷àòü fb2").
|
<br><br> êà÷åñòâå URL ìîæíî çàäàâàòü html-ñòðàíè÷êó ñ êíèãîé, ëèáî ïðÿìóþ ññûëêó íà ôàéë èç îíëàéí-áèáëèîòåêè (íàïðèìåð, ñêîïèðîâàâ àäðåñ ññûëêè èëè êíîïêè "ñêà÷àòü fb2").
|
||||||
Ïîääåðæèâàåìûå ôîðìàòû: <strong>html, txt, fb2, fb2.zip è äðóãèå</strong>
|
Ïîääåðæèâàåìûå ôîðìàòû: <b>fb2, html, txt, rtf, doc, docx, pdf, epub, mobi</b> è ñæàòèå: <b>zip, bz2, gz</b>
|
||||||
|
|
||||||
<br><br>Âû ìîæåòå äîáàâèòü â ñâîé áðàóçåð çàêëàäêó, óêàçàâ â åå ñâîéñòâàõ âìåñòî àäðåñà ñëåäóþùèé êîä:
|
<br><br>Âû ìîæåòå äîáàâèòü â ñâîé áðàóçåð çàêëàäêó, óêàçàâ â åå ñâîéñòâàõ âìåñòî àäðåñà ñëåäóþùèé êîä:
|
||||||
<br><p><strong>javascript:location.href='http://old.omnireader.ru/?url='+location.href;</strong>
|
<br><p><strong>javascript:location.href='http://old.omnireader.ru/?url='+location.href;</strong>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Liberama",
|
"name": "Liberama",
|
||||||
"version": "0.7.4",
|
"version": "0.7.5",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user