Compare commits

...

11 Commits
0.7.4 ... 0.7.5

Author SHA1 Message Date
Book Pauk
3caea77dde Merge branch 'release/0.7.5' 2019-10-22 17:59:05 +07:00
Book Pauk
fdaa3b7f93 Версия 0.7.5 2019-10-22 17:58:20 +07:00
Book Pauk
4f433b4456 Поправил описание 2019-10-22 17:56:17 +07:00
Book Pauk
309a9ad4fb Улучшение синхронизации 2019-10-22 15:41:14 +07:00
Book Pauk
b0e7431e72 Поправки синхронизации 2019-10-21 22:03:00 +07:00
Book Pauk
158118d183 Мелкая поправка 2019-10-21 21:36:43 +07:00
Book Pauk
382e37fc5a Merge tag '0.7.4b' into develop
0.7.4b
2019-10-21 20:13:21 +07:00
Book Pauk
3390676847 Merge branch 'release/0.7.4b' 2019-10-21 20:13:10 +07:00
Book Pauk
544a995312 Поправки багов синхронизации 2019-10-21 20:07:42 +07:00
Book Pauk
f209d49bb5 Поправил настройки кеширования 2019-10-21 13:07:16 +07:00
Book Pauk
42ed691fdc Merge tag '0.7.4' into develop
0.7.4
2019-10-21 12:10:45 +07:00
6 changed files with 77 additions and 78 deletions

View File

@@ -327,7 +327,6 @@ class Reader extends Vue {
(async() => { (async() => {
await bookManager.init(this.settings); await bookManager.init(this.settings);
bookManager.addEventListener(this.bookManagerEvent); bookManager.addEventListener(this.bookManagerEvent);
await this.$refs.serverStorage.init();
if (this.$root.rootRoute == '/reader') { if (this.$root.rootRoute == '/reader') {
if (this.routeParamUrl) { if (this.routeParamUrl) {
@@ -337,6 +336,7 @@ class Reader extends Vue {
} }
} }
await this.$refs.serverStorage.init();
this.checkSetStorageAccessKey(); this.checkSetStorageAccessKey();
this.checkActivateDonateHelpPage(); this.checkActivateDonateHelpPage();
this.loading = false; this.loading = false;
@@ -510,7 +510,7 @@ class Reader extends Vue {
this.debouncedUpdateRoute(); this.debouncedUpdateRoute();
} }
async bookManagerEvent(eventName) { async bookManagerEvent(eventName, value) {
if (eventName == 'set-recent' || eventName == 'recent-deleted') { if (eventName == 'set-recent' || eventName == 'recent-deleted') {
const oldBook = (this.textPage ? this.textPage.lastBook : null); const oldBook = (this.textPage ? this.textPage.lastBook : null);
const oldPos = (this.textPage ? this.textPage.bookPos : null); const oldPos = (this.textPage ? this.textPage.bookPos : null);
@@ -539,6 +539,12 @@ class Reader extends Vue {
if (this.recentBooksActive) { if (this.recentBooksActive) {
await this.$refs.recentBooksPage.updateTableData(); await this.$refs.recentBooksPage.updateTableData();
} }
//сохранение в serverStorage
if (value) {
await utils.sleep(500);
await this.$refs.serverStorage.saveRecent(value);
}
} }
} }

View File

@@ -49,10 +49,6 @@ class ServerStorage extends Vue {
this.saveSettings(); this.saveSettings();
}, 500); }, 500);
this.debouncedSaveRecent = _.debounce((itemKey) => {
this.saveRecent(itemKey);
}, 1000);
this.debouncedNotifySuccess = _.debounce(() => { this.debouncedNotifySuccess = _.debounce(() => {
this.success('Данные синхронизированы с сервером'); this.success('Данные синхронизированы с сервером');
}, 1000); }, 1000);
@@ -81,8 +77,6 @@ class ServerStorage extends Vue {
} else { } else {
await this.serverStorageKeyChanged(); await this.serverStorageKeyChanged();
} }
bookManager.addEventListener(this.bookManagerEvent);
} finally { } finally {
this.inited = true; this.inited = true;
} }
@@ -103,17 +97,6 @@ class ServerStorage extends Vue {
this.cachedRecentMod = value; this.cachedRecentMod = value;
} }
async bookManagerEvent(eventName, itemKey) {
if (!this.serverSyncEnabled)
return;
if (eventName == 'recent-changed') {
if (itemKey) {
this.debouncedSaveRecent(itemKey);
}
}
}
async generateNewServerStorageKey() { async generateNewServerStorageKey() {
const key = utils.toBase58(utils.randomArray(32)); const key = utils.toBase58(utils.randomArray(32));
this.commit('reader/setServerStorageKey', key); this.commit('reader/setServerStorageKey', key);
@@ -449,9 +432,14 @@ 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;
this.savingRecent = true;
try {
const bm = bookManager; const bm = bookManager;
let needSaveRecent = false; let needSaveRecent = false;
@@ -489,6 +477,10 @@ class ServerStorage extends Vue {
//newRecent //newRecent
let newRecent = {}; let newRecent = {};
if (!itemKey || (needSaveRecentPatch && Object.keys(newRecentPatch.data).length > 10)) { 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}; newRecent = {rev: this.cachedRecent.rev + 1, data: bm.recent};
newRecentPatch = {rev: this.cachedRecentPatch.rev + 1, data: {}}; newRecentPatch = {rev: this.cachedRecentPatch.rev + 1, data: {}};
newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}}; newRecentMod = {rev: this.cachedRecentMod.rev + 1, data: {}};
@@ -508,8 +500,6 @@ class ServerStorage extends Vue {
} }
//сохранение //сохранение
this.savingRecent = true;
try {
let result = {state: ''}; let result = {state: ''};
try { try {

View File

@@ -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>

View File

@@ -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>

View File

@@ -18,14 +18,17 @@ server {
proxy_pass http://localhost:44081; proxy_pass http://localhost:44081;
} }
location /tmp { location / {
root /home/liberama/public; root /home/liberama/public;
location /tmp {
add_header Content-Type text/xml; add_header Content-Type text/xml;
add_header Content-Encoding gzip; add_header Content-Encoding gzip;
} }
location / { location ~* \.(?:manifest|appcache|html)$ {
root /home/liberama/public; expires -1;
}
} }
} }

View File

@@ -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"
}, },