From 279959a1f6d23302c990a1012b683492a953e29e Mon Sep 17 00:00:00 2001 From: Philip Montgomery Date: Fri, 6 Dec 2024 22:26:41 -0500 Subject: [PATCH] fix for dlname not getting set on dmcbucket files --- portal-backend/depmap/download/models.py | 4 ++-- portal-backend/depmap/settings/parse_downloads.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/portal-backend/depmap/download/models.py b/portal-backend/depmap/download/models.py index 82610ec6..011d59f7 100755 --- a/portal-backend/depmap/download/models.py +++ b/portal-backend/depmap/download/models.py @@ -180,8 +180,8 @@ def __init__(self, file_name): class DmcBucketUrl(BucketUrl): BUCKET = "depmap-dmc-downloads" - def __init__(self, file_name): - super().__init__(DmcBucketUrl.BUCKET, file_name) + def __init__(self, file_name, dl_name=None): + super().__init__(DmcBucketUrl.BUCKET, file_name=file_name, dl_name=dl_name) def __repr__(self): return "DmcBucketUrl({})".format(repr(self.file_name)) diff --git a/portal-backend/depmap/settings/parse_downloads.py b/portal-backend/depmap/settings/parse_downloads.py index 8f0c5453..ac566a39 100644 --- a/portal-backend/depmap/settings/parse_downloads.py +++ b/portal-backend/depmap/settings/parse_downloads.py @@ -71,10 +71,12 @@ def get_summary_stats(stats: List[Dict[str, Any]]) -> SummaryStats: def get_bucket(url: dict): if url.get("bucket", "") == DmcBucketUrl.BUCKET: - return DmcBucketUrl(url.get("file_name", "")) + return DmcBucketUrl(url.get("file_name", ""), dl_name=url.get("dl_name", "")) else: return BucketUrl( - url.get("bucket", ""), url.get("file_name", ""), url.get("dl_name", "") + url.get("bucket", ""), + url.get("file_name", ""), + dl_name=url.get("dl_name", ""), )