From 898003664f0bfaa9573a03fd37e689a20b1f7511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Pa=CC=88a=CC=88kko=CC=88?= Date: Sun, 20 Aug 2023 22:50:11 +0300 Subject: [PATCH] Bulletproofing discontinued book series merging => no matching book number, append the list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Related to: adfc49a4c9eaa769522477210f7106f4d6ada26e + I mage the "not in library" indicator icon a bit smaller (in the gallery → series subpage) --- src/content-script/content-script-app.vue | 13 +++++++++++-- .../gallery-root/gallery-grid-view/gallery-book.vue | 6 +++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/content-script/content-script-app.vue b/src/content-script/content-script-app.vue index e944dba..5807e0e 100644 --- a/src/content-script/content-script-app.vue +++ b/src/content-script/content-script-app.vue @@ -267,8 +267,17 @@ export default { const newAddition = _.pick(book, [ 'titleShort', 'title', 'cover', 'bookNumbers', 'asin' ]); newAddition.bookNumbers = series.bookNumbers.join(', '); const firstNumber = _.first(series.bookNumbers); - const targetIndex = _.findLastIndex(foundSeries.allBooks, { bookNumbers: firstNumber }); - foundSeries.allBooks.splice(targetIndex+1, 0, newAddition); + const targetIndex = _.findLastIndex(foundSeries.allBooks, ( book ) => { + return book.bookNumbers == firstNumber || book.bookNumbers == newAddition.bookNumbers; + }); + + // Found a book with the same number + if ( targetIndex > -1 ) { + foundSeries.allBooks.splice(targetIndex+1, 0, newAddition); + } + else { + foundSeries.allBooks.push(newAddition); + } } }); } diff --git a/src/gallery/_components/alePages/gallery-root/gallery-grid-view/gallery-book.vue b/src/gallery/_components/alePages/gallery-root/gallery-grid-view/gallery-book.vue index 0679ffb..b3367ca 100644 --- a/src/gallery/_components/alePages/gallery-root/gallery-grid-view/gallery-book.vue +++ b/src/gallery/_components/alePages/gallery-root/gallery-grid-view/gallery-book.vue @@ -522,9 +522,9 @@ div.not-in-library { display: flex; div { background: rgba(#000, .55); - width: 50%; - height: 50%; - font-size: 140%; + width: 25%; + height: 25%; + font-size: 120%; } } }