From e356b874943df44a8c1e0366f80eb3a7779faf84 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 24 Nov 2022 16:54:56 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20opds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/opds/AuthorPage.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/server/core/opds/AuthorPage.js b/server/core/opds/AuthorPage.js index 2b30ab2..e8c3309 100644 --- a/server/core/opds/AuthorPage.js +++ b/server/core/opds/AuthorPage.js @@ -89,10 +89,11 @@ class AuthorPage extends BasePage { if (bookList.books) { let books = JSON.parse(bookList.books); - const filtered = (query.all ? books : this.filterBooks(books, query)); + const booksAll = this.filterBooks(books, {del: 0}); + const filtered = (query.all ? booksAll : this.filterBooks(books, query)); const sorted = this.sortSeriesBooks(filtered); - if (books.length > filtered.length) { + if (booksAll.length > filtered.length) { entry.push( this.makeEntry({ id: 'all_series_books', @@ -105,18 +106,23 @@ class AuthorPage extends BasePage { } for (const book of sorted) { - let title = `${book.serno ? `${book.serno}. `: ''}${book.title || 'Без названия'}`; + const title = `${book.serno ? `${book.serno}. `: ''}${book.title || 'Без названия'} (${book.ext})`; + + const e = { + id: book._uid, + title, + link: this.acqLink({href: `/book?uid=${encodeURIComponent(book._uid)}`}), + }; + if (query.all) { - title = `${this.bookAuthor(book.author)} "${title}"`; + e.content = { + '*ATTRS': {type: 'text'}, + '*TEXT': this.bookAuthor(book.author), + } } - title += ` (${book.ext})`; entry.push( - this.makeEntry({ - id: book._uid, - title, - link: this.acqLink({href: `/book?uid=${encodeURIComponent(book._uid)}`}), - }) + this.makeEntry(e) ); } }