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): def get(self, request, *args, **kwargs):
if 'path' in request.GET.dict() and request.GET.dict()['path']: if 'extensions' in request.GET.dict():
return Response({'tree': get_media_path( extensions = request.GET.dict()['extensions']
request.GET.dict()['path']
)}) if 'path' in request.GET.dict() and request.GET.dict()['path']:
elif 'path' in request.GET.dict(): return Response({'tree': get_media_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: else:
return Response({"success": False}) return Response({"success": False})