This project has moved and is read-only. For the latest updates, please go here.

so different to v2.1-struggling


Sorry if this is abusing the issue tracker but struggling to use v2.1 you simply had to create the tmdb object , call a .MovieSearch which returned a tmdbmovies collection. you then looped the collection of tmdbmovie objects and extracted the info you need.
this component not only has different method but different return types so please point me in the right direction...
How do I get back ALL the results in a collection object-Since this is such a basic request i would have hoped you have a function to do this?
Thanks for your efforts till now


watway wrote Jun 4, 2012 at 11:19 AM

Yes v3 is quite different to v2.1...but in the interest of reducing the volume of data being sent back in v2.1, it's probably a good move. By the way, I didn't write the library that contains the MovieSearch method and TmdbMovie object, so there will be some differences.

The api call to search for a movie splits the results into "pages" of, at most, 20 movies. The resulting object also includes the total number of pages that match the search. For example, result of searching for "Star" produces 22 pages for a total of 439 matching results. This means you would call the SearchMovie method 22 times to get the full collection.

Note that I have no control over the api made available by The Movie DB, so I can't make a method to get a full collection of movies in one call. If you really need to work with the full collection then you could write something like:
        Tmdb api = new Tmdb("apikey");

        List<MovieResult> movieList = new List<MovieResult>();
        TmdbMovieSearch result = null;
        int page = 1;
            result = api.SearchMovie("Star", page);
            if (result == null)

        } while (page <= result.total_pages);

        Assert.IsNotNull (result);
        Assert.AreEqual(result.total_results, movieList.Count);
Hope this helps...

wrote Feb 14, 2013 at 7:53 PM

msavazzi wrote Feb 20, 2013 at 1:33 PM

Also note that if you retrieve the images the API v3 will return only ONE value per movie while the v2 was returning a different value per each format.

You need to build back the array using the values returned in the V3 configuration