mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +01:00
Added isbn search
Search now also searches books using isbn. ISBN match has to be exact to prevent isbn matches to flood results.
This commit is contained in:
parent
4aa6c84252
commit
2f8a90c21a
@ -279,7 +279,11 @@ class Book {
|
|||||||
// var authorMatch = this._author.toLowerCase().includes(search)
|
// var authorMatch = this._author.toLowerCase().includes(search)
|
||||||
var seriesMatch = this._series.toLowerCase().includes(search)
|
var seriesMatch = this._series.toLowerCase().includes(search)
|
||||||
|
|
||||||
var bookMatchKey = titleMatch ? 'title' : subtitleMatch ? 'subtitle' : authorsMatched.length ? 'authorFL' : seriesMatch ? 'series' : false
|
// ISBN match has to be exact to prevent isbn matches to flood results. Remove dashes since isbn might have those
|
||||||
|
var isbnMatch = this.isbn.toLowerCase().replaceAll('-', '') === search.replaceAll('-', '')
|
||||||
|
|
||||||
|
var bookMatchKey = titleMatch ? 'title' : subtitleMatch ? 'subtitle' : authorsMatched.length ? 'authorFL' : seriesMatch ? 'series' : isbnMatch ? 'isbn' : false
|
||||||
|
|
||||||
var bookMatchText = bookMatchKey ? this[bookMatchKey] : ''
|
var bookMatchText = bookMatchKey ? this[bookMatchKey] : ''
|
||||||
return {
|
return {
|
||||||
book: bookMatchKey,
|
book: bookMatchKey,
|
||||||
|
Loading…
Reference in New Issue
Block a user