diff --git a/icon-108x108.png b/icon-108x108.png new file mode 100644 index 0000000..8a3340d Binary files /dev/null and b/icon-108x108.png differ diff --git a/icon-tv-108x108.png b/icon-tv-108x108.png new file mode 100644 index 0000000..61351f2 Binary files /dev/null and b/icon-tv-108x108.png differ diff --git a/lib/handlers.js b/lib/handlers.js index 30dd38f..068bc0c 100644 --- a/lib/handlers.js +++ b/lib/handlers.js @@ -35,12 +35,18 @@ function handleFindShowIntent(req, resp) { resp.say('Couldn\'t find ' + showName + ' queued for download. '); sb.cmd('sb.searchtvdb', {name: showName}).then(function (searchResults) { - utils.sendSearchResponse(searchResults.data.results, resp); + utils + .createSearchResponse(searchResults.data.results, resp) + .send(); }); } else { resp - .say(['It looks like', result.show_name, 'is already on your list.'].join(' ')) + .say([ + 'It looks like', + result.show_name.replace('\'s', 's'), + 'is already on your list.' + ].join(' ')) .send(); } }); @@ -53,7 +59,9 @@ function handleAddShowIntent(req, resp) { var showName = req.slot('showName'); sb.cmd('sb.searchtvdb', {name: showName}).then(function (searchResults) { - utils.sendSearchResponse(searchResults.data.results, resp); + utils + .createSearchResponse(searchResults.data.results, resp) + .send(); }); //Async response @@ -66,7 +74,7 @@ function handleYesIntent(req, resp) { if (!promptData) { console.log('Got a AMAZON.YesIntent but no promptData. Ending session.'); - resp.send(); + resp.shouldEndSession(true).send(); } else if (promptData.yesAction === 'addShow') { show = promptData.searchResults[0]; @@ -95,7 +103,7 @@ function handleNoIntent(req, resp) { if (!promptData) { console.log('Got a AMAZON.YesIntent but no promptData. Ending session.'); - resp.send(); + resp.shouldEndSession(true).send(); } else if (promptData.noAction === 'endSession') { resp.say(promptData.noResponse).send(); diff --git a/lib/utils.js b/lib/utils.js index 6ae9ae1..d592967 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -17,19 +17,18 @@ function buildPrompt(shows) { return promptData; } -function sendSearchResponse(shows, resp) { +function createSearchResponse(shows, resp) { if(!shows || !shows.length) { return resp.say('No show found for ' + showName).send(); } - resp + return resp .say(['Add', shows[0].name, 'to your list?'].join(' ')) .session('promptData', buildPrompt(shows.slice(0, 5))) - .shouldEndSession(false) - .send(); + .shouldEndSession(false); } module.exports = { buildPrompt: buildPrompt, - sendSearchResponse: sendSearchResponse + createSearchResponse: createSearchResponse };