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 @@
Оригинал
- Скачать FB2 + Скачать FB2
@@ -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(' - ');