kriboogh / TMDB4PHP

PHP wrapper classes for TMDB (TheMovieDatabase) API v3
37 stars 16 forks source link

One word movie search issue #2

Open jackdoe00 opened 10 years ago

jackdoe00 commented 10 years ago

There seems to be an issue with searching for a one word movie title, my script hangs.

$results = $db->search('movie', array('query'=>$title));

Or am i missing something here?

kdallas commented 5 years ago

I realise this is nearly 5 years after your post, but I discovered this repo only recently. I have a fix which may already have been applied in one of the many forks, so it probably should go into a pull request. Anyway, it stems from not having page=1 in the request. I was searching for the title "Up", year "2009" -- and it was always timing out. No doubt thousands of partial matches. In Client.php, you can add the following fix to the send_request() method:

        if ($method!='configuration' && $this->paged) {
            $params['page'] = 1;
        }

Obviously this won't work if you've set the "paged" property to false.