id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,mlocked 13325,tmdb3 python bindings wait too long for the API rate limit to expire,jasongillis,Raymond Wagner,"For a long time now, I've been noticing that fetching video metadata became really slow. I put up with it (for three years!) until this weekend when I had some time to dig in. In looking at the debug for tmdb3.py, it notes that after 40 queries, it sleeps for 10 seconds. It should be sleeping until the current 40 reqs / 10 seconds rate window is closed instead of waiting 10 seconds. I was seeing 40 requests in about 9 seconds due to network latency, so it should have been sleeping 1 second or so. It turns out that when handling of the rate limiting was put in, max() was used instead of min(). The section of code that changed should have used min() since it needs to wait for up to 10 seconds to comply with the rate limit guidelines set by tmdb (https://www.themoviedb.org/faq/api). Pull request for this trivial change is: https://github.com/MythTV/mythtv/pull/171 This is my first ever pull request, so let me know if I've done this wrong. Thanks, Jason",Patch - Bug Fix,closed,trivial,needs_triage,Bindings - Python,Master Head,medium,Trac EOL,,,0