See #432: added tag search in sidebar

This commit is contained in:
Eliot Berriot 2019-07-18 15:26:30 +02:00
parent d808a1f1ac
commit e21e0e50d1
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
2 changed files with 31 additions and 12 deletions

View file

@ -32,6 +32,7 @@ export default {
let artistLabel = this.$pgettext('*/*/*/Noun', 'Artist')
let albumLabel = this.$pgettext('*/*/*', 'Album')
let trackLabel = this.$pgettext('*/*/*/Noun', 'Track')
let tagLabel = this.$pgettext('*/*/*/Noun', 'Tag')
let self = this
var searchQuery;
@ -75,6 +76,9 @@ export default {
},
getDescription (r) {
return ''
},
getId (t) {
return t.id
}
},
{
@ -86,6 +90,9 @@ export default {
},
getDescription (r) {
return ''
},
getId (t) {
return t.id
}
},
{
@ -97,6 +104,23 @@ export default {
},
getDescription (r) {
return ''
},
getId (t) {
return t.id
}
},
{
code: 'tags',
route: 'library.tags.detail',
name: tagLabel,
getTitle (r) {
return r.name
},
getDescription (r) {
return ''
},
getId (t) {
return t.name
}
}
]
@ -106,13 +130,14 @@ export default {
results: []
}
initialResponse[category.code].forEach(result => {
let id = category.getId(result)
results[category.code].results.push({
title: category.getTitle(result),
id: result.id,
id,
routerUrl: {
name: category.route,
params: {
id: result.id
id
}
},
description: category.getDescription(result)