mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-08 00:08:14 +01:00
[cleanup] refactor OpenLib sort into getOpenLibResult
This commit is contained in:
parent
f0929729a3
commit
1d3ad38187
@ -136,6 +136,10 @@ class BookFinder {
|
|||||||
if (!booksFiltered.length && books.length) {
|
if (!booksFiltered.length && books.length) {
|
||||||
if (this.verbose) Logger.debug(`Search has ${books.length} matches, but no close title matches`)
|
if (this.verbose) Logger.debug(`Search has ${books.length} matches, but no close title matches`)
|
||||||
}
|
}
|
||||||
|
booksFiltered.sort((a, b) => {
|
||||||
|
return a.totalDistance - b.totalDistance
|
||||||
|
})
|
||||||
|
|
||||||
return booksFiltered
|
return booksFiltered
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,12 +286,6 @@ class BookFinder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (provider === 'openlibrary') {
|
|
||||||
books.sort((a, b) => {
|
|
||||||
return a.totalDistance - b.totalDistance
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return books
|
return books
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user