Upload working + fixes

pull/1122/head
Luca Di Leo 2022-01-17 02:06:50 -08:00
rodzic ef52c954bd
commit 58ee3a5096
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -217,7 +217,7 @@ def import_files(task_id, carrier):
#headers = CaseInsensitiveDict()
headers = {}
if carrier.token != None:
if carrier['token'] != None:
headers['Authorization'] = 'Token ' + carrier['token']
def download_file(task, file):

Wyświetl plik

@ -147,7 +147,10 @@ class DroneDB:
# Get the folders
response = self.wrapped_call('GET', self.__get_files_list_url.format(orgSlug, dsSlug), params=params)
return [{'path': o['path'],
return [
{'path': o['path'],
# extract name from path
'name': o['path'].split('/')[-1],
'type': o['type'],
'size': o['size'],
'url': self.__download_file_url.format(orgSlug, dsSlug, o['path'])