-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better handling of requests that fetch large amounts of tracks #13
Comments
I can understand, as the response time is indeed only 10 seconds. Sometimes, when the local internet is slow, it doesn't even take a 100+ track request to timeout the response. |
Haven't looked at putting a proper solution for this, though I have improved things on my setup. I've moved away from using Heroku and am instead just hosting locally (using ngrok to expose the server for now). And what that means is that I can then use the local Plex URL for searching and performing artist/album lookups. Obviously the external Plex URL is still needed to play tracks as the request for that is coming from the Alexa servers. And if the local URL is set on the environment it'll fall back to using the external URL for searching//lookups, which means the code will still work when hosted on Heroku/anywhere external. So as a result a request that returns 200+ tracks is now completing in ~5s, which covers my needs for now. I can make a pull request for the changes if you like, nothing much to it and it just requires an extra environment variable to be set. |
I have also thought of that solution, but, many people will not be able to do this at home. If you would make it so that, if the extra environmental variable isn't set, that it will still work, you should push it. This is just to introduce a little backwards compatibility :) |
Perform searches using local URL if environment variable is set - #13
This is something that only really applies when trying to play everything by an artist for whom you have a lot of albums/tracks.
If, for example, you have 20 albums by an artist, each containing 10 tracks, you'd have to make 221 requests (1 for the artist, 20 for the albums and 200 for the tracks) to Plex when using the "play artist" intent. This can obviously take a while to conplete, often longer than Alexa allows for the response.
Not sure of the best approach for handling this and I don't now Python well enough to know the options available. Add the first album to the queue and fetch the rest asynchronously maybe? Or pull back, say, 100 tracks and have some placeholder at the end of the queue telling it to fetch the next batch when it gets to that point? Or maybe just limit each request to ~100 tracks and let the user know that they'll have to be more specific to play others?
The text was updated successfully, but these errors were encountered: