get extensions

This commit is contained in:
Jonathan Baecker 2020-04-16 18:26:05 +02:00
parent 07cae246a0
commit b3d238c28c

View File

@ -122,12 +122,17 @@ class Media(APIView):
"""
def get(self, request, *args, **kwargs):
if 'path' in request.GET.dict() and request.GET.dict()['path']:
return Response({'tree': get_media_path(
request.GET.dict()['path']
)})
elif 'path' in request.GET.dict():
return Response({'tree': get_media_path()})
if 'extensions' in request.GET.dict():
extensions = request.GET.dict()['extensions']
if 'path' in request.GET.dict() and request.GET.dict()['path']:
return Response({'tree': get_media_path(
extensions, request.GET.dict()['path']
)})
elif 'path' in request.GET.dict():
return Response({'tree': get_media_path(extensions)})
else:
return Response({"success": False})
else:
return Response({"success": False})