forked from platypush/platypush
Better filtering of music results
This commit is contained in:
parent
abdc5a5ed0
commit
de7a8067cb
1 changed files with 12 additions and 9 deletions
|
@ -713,15 +713,18 @@ $(document).ready(function() {
|
||||||
if (Object.keys(searchFilters).length > 1) {
|
if (Object.keys(searchFilters).length > 1) {
|
||||||
results = results.filter(function(item) {
|
results = results.filter(function(item) {
|
||||||
return (
|
return (
|
||||||
('title' in searchFilters && 'title' in item
|
('title' in searchFilters
|
||||||
? item.title.toLowerCase().indexOf(
|
? (item.title || '').toLowerCase().indexOf(
|
||||||
searchFilters.title.toLowerCase()) >= 0 : true) &&
|
searchFilters.title.toLowerCase()) >= 0
|
||||||
('album' in searchFilters && 'album' in item
|
: true) &&
|
||||||
? item.album.toLowerCase().indexOf(
|
('album' in searchFilters
|
||||||
searchFilters.album.toLowerCase()) >= 0 : true) &&
|
? (item.album || '').toLowerCase().indexOf(
|
||||||
('albumartist' in searchFilters && 'artist' in item
|
searchFilters.album.toLowerCase()) >= 0
|
||||||
? item.artist.toLowerCase().indexOf(
|
: true) &&
|
||||||
searchFilters.albumartist.toLowerCase()) >= 0 : true)
|
('albumartist' in searchFilters
|
||||||
|
? (item.artist || '').toLowerCase().indexOf(
|
||||||
|
searchFilters.albumartist.toLowerCase()) >= 0
|
||||||
|
: true)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue