-
Notifications
You must be signed in to change notification settings - Fork 109
Reprompt to keep session alive for long downloads #59
Conversation
}); | ||
} | ||
|
||
function check_cache_ready(id, timeout) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will periodically (per CACHE_POLLING_INTERVAL
) check if the cache is ready up until timeout
, when Alexa has to reprompt the user to avoid being timed out.
else { | ||
wait_for_video(id, callback); | ||
} | ||
request(heroku + "/alexa/v3/cache/" + id, function(err, res, body) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it from "wait and check" to "check and wait" to save the few seconds in case the cache should be already ready (e.g. from previous searches).
} | ||
else { | ||
else if (!interactive_wait) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interactive_wait
defaults to false
to make it backward compatible.
@@ -1,14 +1,14 @@ | |||
module.exports = { | |||
"en-US": { | |||
"NO_RESULTS_FOUND": "{0} did not return any results on YouTube.", | |||
"ASK_TO_PLAY": "I found a video called {0}. Would you like me to play it?", | |||
"ASK_TO_PLAY": "I found a video called {0}. Would you like me to download it now?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed "play" to "download" since there could be a long wait until the play finally starts. Also added "now" to the end to make "it" sound better 😃
I'll take a look this weekend! Thanks for the PR! |
@chokkyvista This looks pretty good! However, the backwards compatibility feature isn't really working: it just doesn't download for me. I'll fix this up and then accept the merge. |
A potential temporary working fix for #56 : keep reprompting users every 45 seconds or so (which you can override with
ALEXA_REQUEST_TIMEOUT
) for confirmation to keep the session from being timed out while the heroku server is busy downloading long videos.