Просмотр исходного кода

Добавлено отображение имени автора

Book Pauk 2 лет назад
Родитель
Сommit
4ad5aad64e
2 измененных файлов с 22 добавлено и 28 удалено
  1. 13 14
      server/core/opds/AuthorPage.js
  2. 9 14
      server/core/opds/SeriesPage.js

+ 13 - 14
server/core/opds/AuthorPage.js

@@ -105,21 +105,16 @@ class AuthorPage extends BasePage {
                 for (const book of sorted) {
                 for (const book of sorted) {
                     const title = `${book.serno ? `${book.serno}. `: ''}${book.title || 'Без названия'} (${book.ext})`;
                     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(
                     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,
                                 id: b.book._uid,
                                 title,
                                 title,
                                 link: this.acqLink({href: `/book?uid=${encodeURIComponent(b.book._uid)}`}),
                                 link: this.acqLink({href: `/book?uid=${encodeURIComponent(b.book._uid)}`}),
+                                content: {
+                                    '*ATTRS': {type: 'text'},
+                                    '*TEXT': this.bookAuthor(b.book.author),
+                                },
                             })
                             })
                         );
                         );
                     }
                     }

+ 9 - 14
server/core/opds/SeriesPage.js

@@ -64,21 +64,16 @@ class SeriesPage extends BasePage {
                 for (const book of sorted) {
                 for (const book of sorted) {
                     const title = `${book.serno ? `${book.serno}. `: ''}${book.title || 'Без названия'} (${book.ext})`;
                     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(
                     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),
+                            },
+                        })
                     );
                     );
                 }
                 }
             }
             }