From 4ad5aad64e993e8974af7d916dc02163853890b4 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 4 Dec 2022 20:15:17 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=BC=D0=B5=D0=BD=D0=B8=20=D0=B0?= =?UTF-8?q?=D0=B2=D1=82=D0=BE=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/opds/AuthorPage.js | 27 +++++++++++++-------------- server/core/opds/SeriesPage.js | 23 +++++++++-------------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/server/core/opds/AuthorPage.js b/server/core/opds/AuthorPage.js index 3a4302b..cb33bc9 100644 --- a/server/core/opds/AuthorPage.js +++ b/server/core/opds/AuthorPage.js @@ -105,21 +105,16 @@ class AuthorPage extends BasePage { for (const book of sorted) { 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) { - e.content = { - '*ATTRS': {type: 'text'}, - '*TEXT': this.bookAuthor(book.author), - } - } - entry.push( - this.makeEntry(e) + this.makeEntry({ + id: book._uid, + title, + link: this.acqLink({href: `/book?uid=${encodeURIComponent(book._uid)}`}), + content: { + '*ATTRS': {type: 'text'}, + '*TEXT': this.bookAuthor(book.author), + }, + }) ); } } @@ -153,6 +148,10 @@ class AuthorPage extends BasePage { id: b.book._uid, title, link: this.acqLink({href: `/book?uid=${encodeURIComponent(b.book._uid)}`}), + content: { + '*ATTRS': {type: 'text'}, + '*TEXT': this.bookAuthor(b.book.author), + }, }) ); } diff --git a/server/core/opds/SeriesPage.js b/server/core/opds/SeriesPage.js index 8134211..5c54a80 100644 --- a/server/core/opds/SeriesPage.js +++ b/server/core/opds/SeriesPage.js @@ -64,21 +64,16 @@ class SeriesPage extends BasePage { for (const book of sorted) { 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) { - e.content = { - '*ATTRS': {type: 'text'}, - '*TEXT': this.bookAuthor(book.author), - } - } - entry.push( - this.makeEntry(e) + this.makeEntry({ + id: book._uid, + title, + link: this.acqLink({href: `/book?uid=${encodeURIComponent(book._uid)}`}), + content: { + '*ATTRS': {type: 'text'}, + '*TEXT': this.bookAuthor(book.author), + }, + }) ); } }