Improve spotify matching

This commit is contained in:
Jonathan Cremin 2017-05-07 20:36:20 +01:00
parent d6352b6250
commit c5ea8f5b7a
2 changed files with 7 additions and 1 deletions

View file

@ -86,6 +86,7 @@ export function* search(data) {
}
const results = yield spotify.searchAsync({query: query, type: type});
if (!results[type + "s"].items[0]) {
return {service: "spotify"};
} else {
@ -97,7 +98,7 @@ export function* search(data) {
results[type + "s"].items.forEach(function(item) {
const albumName = data.type == "album" ? item.name : item.album.name;
const matches = albumName.match(/^[^\(\[]+/);
const matches = cleanParam(albumName).match(/^[^\(\[]+/);
if(choppedAlbum.indexOf(matches[0]) >= 0) {
found = item;
}