Skip to content

Commit

Permalink
Bulletproofing discontinued book series merging => no matching book n…
Browse files Browse the repository at this point in the history
…umber, append the list

Related to: adfc49a

+ I mage the "not in library" indicator icon a bit smaller (in the gallery → series subpage)
  • Loading branch information
joonaspaakko committed Aug 20, 2023
1 parent b8208f2 commit 8980036
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
13 changes: 11 additions & 2 deletions src/content-script/content-script-app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
}
}
}
Expand Down

0 comments on commit 8980036

Please sign in to comment.