youpy/ruby-lastfm

Structure of return from track.search is different if there is one match only

Sleft opened this issue · 2 comments

If there is only one match

@lastfm.track.search(track: song.to_search_term)['results']['trackmatches']['track']

returns a hash but otherwise it returns an array. Is this intended?

Currently I hack around this fact by putting the resulting hash in an array if there only one match.

That was fast. Thanks!

Thanks for reporting!