From d544540454d7f4e116f5f58bba886c96c8375447 Mon Sep 17 00:00:00 2001 From: advplyr Date: Thu, 2 Dec 2021 19:02:38 -0600 Subject: [PATCH] Add:Experimental authors page layout #187,Add:Square covers #210 --- .../components/app/BookShelfCategorized.vue | 29 ++++--- client/components/app/BookShelfRow.vue | 10 +++ client/components/app/LazyBookshelf.vue | 2 +- client/components/app/SideRail.vue | 19 ++++- client/components/app/StreamContainer.vue | 14 +++- .../components/cards/AudiobookSearchCard.vue | 9 ++- client/components/cards/AuthorCard.vue | 77 +++++++++++++++++++ client/components/cards/PersonCard.vue | 56 -------------- client/components/cards/SeriesSearchCard.vue | 8 +- client/components/covers/PreviewCover.vue | 7 +- .../components/modals/EditCollectionModal.vue | 5 +- client/components/modals/edit-tabs/Cover.vue | 14 +++- .../tables/CollectionBooksTable.vue | 8 +- .../tables/collection/BookTableRow.vue | 13 +++- client/pages/audiobook/_id/index.vue | 8 +- client/pages/batch/index.vue | 8 +- client/pages/collection/_id.vue | 5 +- client/pages/config/index.vue | 7 -- client/pages/config/users/_id.vue | 8 +- .../pages/library/_library/authors/index.vue | 61 +++++++++++++++ .../pages/library/_library/bookshelf/_id.vue | 5 -- client/store/index.js | 4 + server/ApiController.js | 1 + server/controllers/LibraryController.js | 38 +++++++-- 24 files changed, 304 insertions(+), 112 deletions(-) create mode 100644 client/components/cards/AuthorCard.vue delete mode 100644 client/components/cards/PersonCard.vue create mode 100644 client/pages/library/_library/authors/index.vue diff --git a/client/components/app/BookShelfCategorized.vue b/client/components/app/BookShelfCategorized.vue index 70a1a220..e2b82efb 100644 --- a/client/components/app/BookShelfCategorized.vue +++ b/client/components/app/BookShelfCategorized.vue @@ -65,7 +65,8 @@ export default { return this.isCoverSquareAspectRatio ? 1 : 1.6 }, sizeMultiplier() { - return this.bookCoverWidth / 120 + var baseSize = this.isCoverSquareAspectRatio ? 192 : 120 + return this.bookCoverWidth / baseSize } }, methods: { @@ -105,16 +106,6 @@ export default { }) } - // TODO: Author shelves - // if (this.results.authors) { - // shelves.push({ - // id: 'authors', - // label: 'Authors', - // type: 'authors', - // entities: this.results.authors.map((a) => a.author) - // }) - // } - if (this.results.series) { shelves.push({ id: 'series', @@ -143,6 +134,22 @@ export default { }) }) } + if (this.results.authors) { + shelves.push({ + id: 'authors', + label: 'Authors', + type: 'authors', + entities: this.results.authors.map((a) => { + return { + id: a.author, + name: a.author, + numBooks: a.numBooks, + type: 'author' + } + }) + }) + } + this.shelves = shelves }, settingsUpdated(settings) {}, diff --git a/client/components/app/BookShelfRow.vue b/client/components/app/BookShelfRow.vue index 6d653789..c8152010 100644 --- a/client/components/app/BookShelfRow.vue +++ b/client/components/app/BookShelfRow.vue @@ -19,6 +19,13 @@ +
+ +