added support for movie search
This commit is contained in:
parent
3117bac8a9
commit
29f0e73c0b
18 changed files with 198 additions and 32 deletions
12
movie_db/views.py
Normal file
12
movie_db/views.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
from django.http import JsonResponse
|
||||
from movie_db.db_providers.omdb import OMDb
|
||||
|
||||
|
||||
def omdb_search(request):
|
||||
query = request.GET.get("q")
|
||||
if not query:
|
||||
return JsonResponse({"Error": "Missing query"}, status=400)
|
||||
|
||||
search_type = request.GET.get("type")
|
||||
omdb = OMDb()
|
||||
return JsonResponse(omdb.search(query, {"type": search_type}), safe=False)
|
Loading…
Add table
Add a link
Reference in a new issue