Allow to search for Spotify playlists by Spotify URI.

Search query should look like e.g.:
"spotify:user:spotify:playlist:2Qi8yAzfj1KavAhWz1gaem"
This commit is contained in:
Szymon Nowak 2014-07-15 11:34:12 +02:00
parent d8aa08b4f6
commit 2d95978829

View File

@ -18,7 +18,7 @@ function initSearch() {
if ((value.length < 100) && (value.length > 0)) {
showLoading(true);
//hide ios/android keyboard
//hide ios/android keyboard
document.activeElement.blur();
$("input").blur();
@ -27,10 +27,19 @@ function initSearch() {
delete customTracklists['albumresultscache'];
delete customTracklists['trackresultscache'];
$("#searchresults").hide();
mopidy.library.search({
any: [value]
}).then(processSearchResults, console.error);
// console.log('search sent', value);
var query = {},
uris = [];
if (value.match(/^spotify:/)) {
query = {uri: [value]};
uris = ["spotify:"];
} else {
query = {any: [value]};
}
mopidy.library.search(query, uris).then(processSearchResults, console.error);
// console.log('search sent', value);
}
}