Skip to content

Commit

Permalink
[enhancement] Treat underscores as title part separators
Browse files Browse the repository at this point in the history
  • Loading branch information
mikiher committed Oct 5, 2023
1 parent f3555a1 commit bf9f389
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/finders/BookFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ class BookFinder {
// Now run up to maxFuzzySearches fuzzy searches
let authorCandidates = new BookFinder.AuthorCandidates(this, cleanAuthor)

// remove parentheses and their contents, and replace with a separator
const cleanTitle = title.replace(/\[.*?\]|\(.*?\)|{.*?}/g, " - ")
// remove underscores and parentheses with their contents, and replace with a separator
const cleanTitle = title.replace(/\[.*?\]|\(.*?\)|{.*?}|_/g, " - ")
// Split title into hypen-separated parts
const titleParts = cleanTitle.split(/ - | -|- /)
for (const titlePart of titleParts)
Expand Down

0 comments on commit bf9f389

Please sign in to comment.