From ddbaadcb9e629a90e96d2cff52e739c61dece7c2 Mon Sep 17 00:00:00 2001 From: burnout87 Date: Thu, 17 Oct 2024 11:27:59 +0200 Subject: [PATCH] build file url --- cdci_data_analysis/analysis/ivoa_helper.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cdci_data_analysis/analysis/ivoa_helper.py b/cdci_data_analysis/analysis/ivoa_helper.py index 120a4f22..69728c04 100644 --- a/cdci_data_analysis/analysis/ivoa_helper.py +++ b/cdci_data_analysis/analysis/ivoa_helper.py @@ -71,6 +71,12 @@ def run_ivoa_query_from_product_gallery(parsed_query_obj, if product_gallery_url is not None: for index, value in enumerate(list_row): description = cursor.description[index] + if description.name in {'file_uri', 'file_name'} and value is not None and isinstance(value, str): + file_name_list = [v.strip() for v in value.split(',')] + if description.name == 'file_uri': + for id, file_name in enumerate(file_name_list): + file_name_list[id] = os.path.join(product_gallery_url, 'sites/default/files/', file_name.strip()) + list_row[index] = file_name_list if description.name in {'path', 'path_alias'} and value is not None and isinstance(value, str): if value.startswith('/'): value = value[1:]