Changed mpd filter to dict on the frontend as well

This commit is contained in:
Fabio Manganiello 2020-03-08 13:07:35 +01:00
parent 42c5bbe0e4
commit 535b2ec083
2 changed files with 5 additions and 5 deletions

View file

@ -761,7 +761,7 @@ Vue.component('music-mpd', {
var info = item; var info = item;
if (typeof(item) === 'string') { if (typeof(item) === 'string') {
var items = await request('music.mpd.search', {filter: ['file', info]}); var items = await request('music.mpd.search', {filter: {file: info}});
item = items.length ? items[0] : {file: info}; item = items.length ? items[0] : {file: info};
} }

View file

@ -121,13 +121,13 @@ Vue.component('music-mpd-search', {
methods: { methods: {
search: async function() { search: async function() {
const filter = Object.keys(this.query).reduce((items, key) => { const filter = Object.keys(this.query).reduce((query, key) => {
if (this.query[key].length) { if (this.query[key].length) {
items.push(key, this.query[key]); query[key] = this.query[key];
} }
return items; return query;
}, []); }, {});
this.results = []; this.results = [];
var results = await request('music.mpd.search', {filter: filter}); var results = await request('music.mpd.search', {filter: filter});