diff --git a/aiphttp_tester.py b/aiphttp_tester.py new file mode 100644 index 0000000..bad9709 --- /dev/null +++ b/aiphttp_tester.py @@ -0,0 +1,13 @@ +from tmdb.tmdb_api import Movie +import asyncio +import time + +async def test(): + start = time.time() + movie = Movie() + await movie.load_parameters() + id = await movie.search_title('Breakfast Club') + print(time.time() - start) + await movie.close_session() + +asyncio.run(test()) diff --git a/tmdb/tmdb_api.py b/tmdb/tmdb_api.py index 46537d0..8edc35c 100644 --- a/tmdb/tmdb_api.py +++ b/tmdb/tmdb_api.py @@ -124,10 +124,10 @@ class Movie(TmdbApiSingle): json = await self.request('search/movie', params=payload) if json['total_results'] > 0: movie_id = json['results'][0]['id'] - #await asyncio.gather( - await self.query_details(movie_id) - await self.query_cast(movie_id) - #) + await asyncio.gather( + self.query_details(movie_id), + self.query_cast(movie_id) + ) return movie_id async def query_details(self, id):