From 3a211ded2e96ed9c8dc238f28961ed62f827438d Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 20 Nov 2020 21:43:37 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B9=20=D1=80?= =?UTF-8?q?=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=BD=D0=B3,?= =?UTF-8?q?=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20?= =?UTF-8?q?=D1=83=D0=B4=D0=BE=D0=B1=D0=BE=D1=87=D0=B8=D1=82=D0=B0=D0=B5?= =?UTF-8?q?=D0=BC=D0=BE=D0=B5=20=D0=B8=D0=BC=D1=8F=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=BD=D0=B8?= =?UTF-8?q?=D0=B8=20fb2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RecentBooksPage/RecentBooksPage.vue | 22 +++++++++---------- .../components/Reader/TextPage/TextPage.vue | 2 +- client/share/utils.js | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/client/components/Reader/RecentBooksPage/RecentBooksPage.vue b/client/components/Reader/RecentBooksPage/RecentBooksPage.vue index d51b1b6f..c7eec977 100644 --- a/client/components/Reader/RecentBooksPage/RecentBooksPage.vue +++ b/client/components/Reader/RecentBooksPage/RecentBooksPage.vue @@ -59,7 +59,7 @@ @@ -237,9 +237,10 @@ class RecentBooksPage extends Vue { author, title: `${title}${perc}${textLen}`, }, - descString: `${author}${title}${perc}${textLen}`, + descString: `${author}${title}${perc}${textLen}`,//для сортировки url: book.url, path: book.path, + fullTitle: bt.fullTitle, key: book.key, }); } @@ -272,13 +273,18 @@ class RecentBooksPage extends Vue { return `${(this.search ? 'Найдено' : 'Всего')} ${len} книг${this.wordEnding(len)}`; } - async downloadBook(fb2path) { + async downloadBook(fb2path, fullTitle) { try { await readerApi.checkCachedBook(fb2path); const d = this.$refs.download; d.href = fb2path; - d.download = path.basename(fb2path).substr(0, 10) + '.fb2'; + try { + const fn = utils.makeValidFilename(fullTitle); + d.download = fn.substring(0, 100) + '.fb2'; + } catch(e) { + d.download = path.basename(fb2path).substr(0, 10) + '.fb2'; + } d.click(); } catch (e) { @@ -289,14 +295,6 @@ class RecentBooksPage extends Vue { } } - openOriginal(url) { - window.open(url, '_blank'); - } - - openFb2(path) { - window.open(path, '_blank'); - } - async handleDel(key) { await bookManager.delRecentBook({key}); //this.updateTableData();//обновление уже происходит Reader.bookManagerEvent diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index a2c53866..7685e294 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -393,7 +393,7 @@ class TextPage extends Vue { this.meta = bookManager.metaOnly(this.book); const bt = utils.getBookTitle(this.meta.fb2); - this.title = bt.title; + this.title = bt.fullTitle; this.$root.$emit('set-app-title', this.title); diff --git a/client/share/utils.js b/client/share/utils.js index 1c3af291..c68d48a7 100644 --- a/client/share/utils.js +++ b/client/share/utils.js @@ -349,7 +349,7 @@ export function getBookTitle(fb2) { result.bookTitle = _.compact([result.sequenceTitle, fb2.bookTitle]).join(' '); - result.title = _.compact([ + result.fullTitle = _.compact([ result.author, result.bookTitle ]).join(' - ');