mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-02 09:41:07 +00:00
clean up API logging
This commit is contained in:
parent
d0124c1a5c
commit
13d1927840
@ -43,7 +43,6 @@ class ApiBaseView(APIView):
|
|||||||
def get_document(self, document_id):
|
def get_document(self, document_id):
|
||||||
"""get single document from es"""
|
"""get single document from es"""
|
||||||
path = f"{self.search_base}{document_id}"
|
path = f"{self.search_base}{document_id}"
|
||||||
print(path)
|
|
||||||
response, status_code = ElasticWrap(path).get()
|
response, status_code = ElasticWrap(path).get()
|
||||||
try:
|
try:
|
||||||
self.response["data"] = SearchProcess(response).process()
|
self.response["data"] = SearchProcess(response).process()
|
||||||
@ -64,8 +63,6 @@ class ApiBaseView(APIView):
|
|||||||
|
|
||||||
def get_document_list(self, request, pagination=True):
|
def get_document_list(self, request, pagination=True):
|
||||||
"""get a list of results"""
|
"""get a list of results"""
|
||||||
print(self.search_base)
|
|
||||||
|
|
||||||
if pagination:
|
if pagination:
|
||||||
self.initiate_pagination(request)
|
self.initiate_pagination(request)
|
||||||
|
|
||||||
@ -437,7 +434,6 @@ class DownloadApiListView(ApiBaseView):
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def post(request):
|
def post(request):
|
||||||
"""add list of videos to download queue"""
|
"""add list of videos to download queue"""
|
||||||
print(f"request meta data: {request.META}")
|
|
||||||
data = request.data
|
data = request.data
|
||||||
try:
|
try:
|
||||||
to_add = data["data"]
|
to_add = data["data"]
|
||||||
@ -524,10 +520,7 @@ class TaskApiView(ApiBaseView):
|
|||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
"""handle post request"""
|
"""handle post request"""
|
||||||
|
response = TaskHandler(request.data).run_task()
|
||||||
data = request.data
|
|
||||||
print(data)
|
|
||||||
response = TaskHandler(data).run_task()
|
|
||||||
|
|
||||||
return Response(response)
|
return Response(response)
|
||||||
|
|
||||||
@ -662,6 +655,6 @@ class SearchView(ApiBaseView):
|
|||||||
return Response(
|
return Response(
|
||||||
{"message": "no search query specified"}, status=400
|
{"message": "no search query specified"}, status=400
|
||||||
)
|
)
|
||||||
print("searching for: " + search_query)
|
|
||||||
search_results = SearchForm().multi_search(search_query)
|
search_results = SearchForm().multi_search(search_query)
|
||||||
return Response(search_results)
|
return Response(search_results)
|
||||||
|
Loading…
Reference in New Issue
Block a user