mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
[enhancement] Treat underscores as title part separators
This commit is contained in:
parent
f3555a12ce
commit
bf9f3895db
@ -372,8 +372,8 @@ class BookFinder {
|
|||||||
// Now run up to maxFuzzySearches fuzzy searches
|
// Now run up to maxFuzzySearches fuzzy searches
|
||||||
let authorCandidates = new BookFinder.AuthorCandidates(this, cleanAuthor)
|
let authorCandidates = new BookFinder.AuthorCandidates(this, cleanAuthor)
|
||||||
|
|
||||||
// remove parentheses and their contents, and replace with a separator
|
// remove underscores and parentheses with their contents, and replace with a separator
|
||||||
const cleanTitle = title.replace(/\[.*?\]|\(.*?\)|{.*?}/g, " - ")
|
const cleanTitle = title.replace(/\[.*?\]|\(.*?\)|{.*?}|_/g, " - ")
|
||||||
// Split title into hypen-separated parts
|
// Split title into hypen-separated parts
|
||||||
const titleParts = cleanTitle.split(/ - | -|- /)
|
const titleParts = cleanTitle.split(/ - | -|- /)
|
||||||
for (const titlePart of titleParts)
|
for (const titlePart of titleParts)
|
||||||
|
Loading…
Reference in New Issue
Block a user