mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-08 00:08:14 +01:00
Remove unnecessary includesAuthorDiff from sorting
This commit is contained in:
parent
5a3d450482
commit
89055f8655
@ -200,9 +200,6 @@ class BookFinder {
|
|||||||
getCandidates() {
|
getCandidates() {
|
||||||
var candidates = [...this.candidates]
|
var candidates = [...this.candidates]
|
||||||
candidates.sort((a, b) => {
|
candidates.sort((a, b) => {
|
||||||
// Candidates that include the author are likely low quality
|
|
||||||
const includesAuthorDiff = a.includes(this.cleanAuthor) - b.includes(this.cleanAuthor)
|
|
||||||
if (includesAuthorDiff) return includesAuthorDiff
|
|
||||||
// Candidates that include only digits are also likely low quality
|
// Candidates that include only digits are also likely low quality
|
||||||
const onlyDigits = /^\d+$/
|
const onlyDigits = /^\d+$/
|
||||||
const includesOnlyDigitsDiff = onlyDigits.test(a) - onlyDigits.test(b)
|
const includesOnlyDigitsDiff = onlyDigits.test(a) - onlyDigits.test(b)
|
||||||
|
Loading…
Reference in New Issue
Block a user