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() => {
await bookManager.init(this.settings);
bookManager.addEventListener(this.bookManagerEvent);
await this.$refs.serverStorage.init();
if (this.$root.rootRoute == '/reader') {
if (this.routeParamUrl) {
@@ -337,6 +336,7 @@ class Reader extends Vue {
}
}
await this.$refs.serverStorage.init();
this.checkSetStorageAccessKey();
this.checkActivateDonateHelpPage();
this.loading = false;
@@ -510,7 +510,7 @@ class Reader extends Vue {
this.debouncedUpdateRoute();
}
async bookManagerEvent(eventName) {
async bookManagerEvent(eventName, value) {
if (eventName == 'set-recent' || eventName == 'recent-deleted') {
const oldBook = (this.textPage ? this.textPage.lastBook : null);
const oldPos = (this.textPage ? this.textPage.bookPos : null);
@@ -539,6 +539,12 @@ class Reader extends Vue {
if (this.recentBooksActive) {
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();
}, 500);
this.debouncedSaveRecent = _.debounce((itemKey) => {
this.saveRecent(itemKey);
}, 1000);
this.debouncedNotifySuccess = _.debounce(() => {
this.success('Данные синхронизированы с сервером');
}, 1000);
@@ -81,8 +77,6 @@ class ServerStorage extends Vue {
} else {
await this.serverStorageKeyChanged();
}
bookManager.addEventListener(this.bookManagerEvent);
} finally {
this.inited = true;
}
@@ -103,17 +97,6 @@ class ServerStorage extends Vue {
this.cachedRecentMod = value;
}
async bookManagerEvent(eventName, itemKey) {
if (!this.serverSyncEnabled)
return;
if (eventName == 'recent-changed') {
if (itemKey) {
this.debouncedSaveRecent(itemKey);
}
}
}
async generateNewServerStorageKey() {
const key = utils.toBase58(utils.randomArray(32));
this.commit('reader/setServerStorageKey', key);
@@ -449,67 +432,74 @@ 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;
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)) {
//ждем весь bm.recent
while (!bookManager.loaded)
await utils.sleep(100);
//query
let query = {};
if (needSaveRecent) {
query = {recent: newRecent, recentPatch: newRecentPatch, recentMod: newRecentMod};
} else if (needSaveRecentPatch) {
query = {recentPatch: newRecentPatch, recentMod: newRecentMod};
} else {
query = {recentMod: newRecentMod};
}
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;
}
//сохранение
this.savingRecent = true;
try {
//query
let query = {};
if (needSaveRecent) {
query = {recent: newRecent, recentPatch: newRecentPatch, recentMod: newRecentMod};
} else if (needSaveRecentPatch) {
query = {recentPatch: newRecentPatch, recentMod: newRecentMod};
} else {
query = {recentMod: newRecentMod};
}
//сохранение
let result = {state: ''};
try {

View File

@@ -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:
`
<ul>

View File

@@ -153,7 +153,7 @@
<p>- ðåãèñòðàöèÿ íå òðåáóåòñÿ
<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><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;
}
location /tmp {
root /home/liberama/public;
add_header Content-Type text/xml;
add_header Content-Encoding gzip;
}
location / {
root /home/liberama/public;
location /tmp {
add_header Content-Type text/xml;
add_header Content-Encoding gzip;
}
location ~* \.(?:manifest|appcache|html)$ {
expires -1;
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "Liberama",
"version": "0.7.4",
"version": "0.7.5",
"engines": {
"node": ">=10.0.0"
},