From 535b2ec08317cd73a3815d46e77ccff4b5a52f92 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 8 Mar 2020 13:07:35 +0100 Subject: [PATCH] Changed mpd filter to dict on the frontend as well --- .../backend/http/static/js/plugins/music.mpd/index.js | 2 +- .../backend/http/static/js/plugins/music.mpd/search.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platypush/backend/http/static/js/plugins/music.mpd/index.js b/platypush/backend/http/static/js/plugins/music.mpd/index.js index eb930c60..0b4e0665 100644 --- a/platypush/backend/http/static/js/plugins/music.mpd/index.js +++ b/platypush/backend/http/static/js/plugins/music.mpd/index.js @@ -761,7 +761,7 @@ Vue.component('music-mpd', { var info = item; 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}; } diff --git a/platypush/backend/http/static/js/plugins/music.mpd/search.js b/platypush/backend/http/static/js/plugins/music.mpd/search.js index 9ec38c4e..dcf8a789 100644 --- a/platypush/backend/http/static/js/plugins/music.mpd/search.js +++ b/platypush/backend/http/static/js/plugins/music.mpd/search.js @@ -121,13 +121,13 @@ Vue.component('music-mpd-search', { methods: { 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) { - items.push(key, this.query[key]); + query[key] = this.query[key]; } - return items; - }, []); + return query; + }, {}); this.results = []; var results = await request('music.mpd.search', {filter: filter});