julianh2o / RokuAlexaLambdaSkill

An Alexa Skill that allows voice control of your Roku
MIT License
104 stars 55 forks source link

Update Search to utilize the Roku firmware 7.5 Search API #24

Closed mikehobi closed 7 years ago

mikehobi commented 7 years ago

This is a Pull Request that allows the Alexa Search command to utilize the new Search API that is implemented on firmware 7.5. I decided to just gut out the old search commands, but if there is any reason to keep them, a version tag on the repo might be helpful for people with older Roku firmwares.

The multiple slots part for SearchChannel was a bit cumbersome and the solution feels messy. I imagine it would be a lot better to pass an object that contains both the title and channel

Removes old "click-sequence" commands:

Adds two new search commands:

Search

There are a couple of key features to Search. Search will search "All" channels defined in the rokuchannels.js file and the API launches based on provider-id order. So if you would like to prioritize Netflix over all other channels, you must move it to the top of your rokuchannels.js file. The channel ids are all fetched by the getAllChannelIds() function and concats them into a URL friendly string.

launch is set to true. This will launch whichever channel has it available even if its free or for rent, and again it chooses the channel based on order.

The parameter match-any is also set to true. This means if there are multiple versions of a film (e.g. "Mad Max"), it will auto-select and play the first option in the results. This can be removed from the request url if someone wanted to search and manually select.

SearchChannel

This is pretty much the same as Search, but it will allow you to specify a channel that is in your rokuchannels.js file (e.g. "Search for Futurama on Netflix").

Note: a few channels won't autoplay the video, but will rather launch you to the specific movie or shows page. Also no channel will attempt to purchase either :P


There's a few parameters that are unused, because they're a bit harder to implement with Alexa:

If anyone has any ideas of how to implement these, that would be awesome!

closes #19

mikehobi commented 7 years ago

@julianh2o Just want to get your eyes on this again. Any thoughts?

julianh2o commented 7 years ago

Woops, sorry, my bad.. I must have missed the email! Thanks for the contribution and sorry for the delay!