mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-14 07:49:37 +00:00
New search page, updated search menu includes tags #112
This commit is contained in:
parent
aa872948d5
commit
48f0e039e5
18 changed files with 259 additions and 57 deletions
|
|
@ -654,11 +654,22 @@ class Audiobook {
|
|||
}
|
||||
|
||||
isSearchMatch(search) {
|
||||
return this.book.isSearchMatch(search.toLowerCase().trim())
|
||||
var tagMatch = this.tags.filter(tag => {
|
||||
return tag.toLowerCase().includes(search.toLowerCase().trim())
|
||||
})
|
||||
return this.book.isSearchMatch(search.toLowerCase().trim()) || tagMatch.length
|
||||
}
|
||||
|
||||
searchQuery(search) {
|
||||
return this.book.getQueryMatches(search.toLowerCase().trim())
|
||||
var matches = this.book.getQueryMatches(search.toLowerCase().trim())
|
||||
matches.tags = this.tags.filter(tag => {
|
||||
return tag.toLowerCase().includes(search.toLowerCase().trim())
|
||||
})
|
||||
if (!matches.book && matches.tags.length) {
|
||||
matches.book = 'tags'
|
||||
matches.bookMatchText = matches.tags.join(', ')
|
||||
}
|
||||
return matches
|
||||
}
|
||||
|
||||
getAudioFileByIno(ino) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue