bencevans / node-sonos

🔈 Sonos Media Player Interface/Client
https://www.npmjs.com/package/sonos
MIT License
704 stars 147 forks source link

Add ability for more complex searchTerm #395

Closed Villarrealized closed 5 years ago

Villarrealized commented 5 years ago

Changed encodeURIComponent to encodeURI to allow for forward slashes within the search term. This allows for deeper browsing/searching which was not possible before as any forward slashes would have been lost to conversion.

// Before
encodeURIComponent('Blues/B.B. King')
// -> Blues%2FB.B.%20King
// With change
encodeURI('Blues/B.B. King')
// -> Blues/B.B.%20King
Villarrealized commented 5 years ago

This could probably be more simply accomplished by leaving the current code as-is but changing from encodeURIComponent to encodeURI which preserves additional slashes.

I think I like that better as it is more flexible and doesn’t add additional parameters to the function and accomplishes the same thing.

What do you think?

phoenixrising87 commented 5 years ago

Yes, I also like this idea more. Keeps the code simpler and more flexible.

Villarrealized commented 5 years ago

Great, I updated the PR with the new changes.

bencevans commented 5 years ago

:tada: This PR is included in version 1.9.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: