This commit is contained in:
lomion 2021-07-03 09:29:08 +02:00
parent 460cb51d86
commit 2ff78cfd4a
2 changed files with 17 additions and 4 deletions

13
aiphttp_tester.py Normal file
View file

@ -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())

View file

@ -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):