Handle bad tracks, tracks with weird names

This commit is contained in:
magnolia-fan
2011-11-24 02:26:04 +04:00
parent 3205af0be6
commit 270d80ee0e
2 changed files with 17 additions and 13 deletions
@@ -59,7 +59,7 @@ class window.VkontakteMusic
data
prepareQuery: (artist, track) ->
artist+" "+track.replace(/\(.*\)/i, '').split('/')[0]
artist+" "+this.trim(/[\w\d\s]+/.exec(track)[0]).replace(/\(.*\)/i, '').split('/')[0]
trim: (str) ->
while str.indexOf(' ') isnt -1