Skip to content

Commit

Permalink
fixed search mpd
Browse files Browse the repository at this point in the history
  • Loading branch information
volumio committed Jun 25, 2016
1 parent 6af0c26 commit 2d641d0
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions app/plugins/music_service/mpd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,12 +1230,25 @@ ControllerMpd.prototype.search = function (query) {
libQ.all(deferArray).then(function(values){
var list = [];

list=[{type:'title',title:self.commandRouter.getI18nString('COMMON.SEARCH_ARTIST_SECTION')}].
concat(values[0]).
concat([{type:'title',title:self.commandRouter.getI18nString('COMMON.SEARCH_ALBUM_SECTION')}]).
concat(values[1]).
concat([{type:'title',title:self.commandRouter.getI18nString('COMMON.SEARCH_SONG_SECTION')}]).
concat(values[2]).filter(function(v){return !!(v)==true;});
if(values[0])
{
list=[{type:'title',title:self.commandRouter.getI18nString('COMMON.SEARCH_ARTIST_SECTION')}].
concat(values[0]);
}

if(values[1])
{
list=list.concat([{type:'title',title:self.commandRouter.getI18nString('COMMON.SEARCH_ALBUM_SECTION')}]).
concat(values[1]);
}

if(values[2])
{
list=list.concat([{type:'title',title:self.commandRouter.getI18nString('COMMON.SEARCH_SONG_SECTION')}]).
concat(values[2]);
}

list=list.filter(function(v){return !!(v)==true;})

defer.resolve(list);
}).fail(function(err){
Expand Down

0 comments on commit 2d641d0

Please sign in to comment.