Skip to content

Commit

Permalink
Merge pull request #323 from asfadmin/feature-find-urls-ext
Browse files Browse the repository at this point in the history
bugfix: slc burst urls works with `find_urls()`
  • Loading branch information
SpicyGarlicAlbacoreRoll authored Jan 14, 2025
2 parents 26589ff + d2e700f commit d38ec84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
-->
------
## [v8.1.1](https://github.com/asfadmin/Discovery-asf_search/compare/v8.1.0...v8.1.1)
### Fixed
- SLC Burst product urls are now searchable with `find_urls()`

------
## [v8.1.0](https://github.com/asfadmin/Discovery-asf_search/compare/v8.0.1...v8.1.0)
### Added
Expand Down
10 changes: 4 additions & 6 deletions asf_search/ASFProduct.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def get_classname(cls):
combine `ASFProduct._base_properties` with their own separately defined `_base_properties`
"""

_url_types = ['GET DATA', 'EXTENDED METADATA', 'GET DATA VIA DIRECT ACCESS', 'GET RELATED VISUALIZATION', 'VIEW RELATED INFORMATION', 'USE SERVICE API']

def __init__(self, args: Dict = {}, session: ASFSession = ASFSession()):
self.meta = args.get('meta')
self.umm = args.get('umm')
Expand Down Expand Up @@ -278,18 +280,14 @@ def _get_access_urls(

def _get_urls(self) -> List[str]:
"""Finds and returns all umm urls"""
urls = self._get_access_urls(
['GET DATA', 'EXTENDED METADATA', 'GET DATA VIA DIRECT ACCESS', 'GET RELATED VISUALIZATION', 'VIEW RELATED INFORMATION']
)
urls = self._get_access_urls(self._url_types)
return [
url for url in urls if not url.startswith('s3://')
]

def _get_s3_uris(self) -> List[str]:
"""Finds and returns all umm S3 direct access uris"""
s3_urls = self._get_access_urls(
['GET DATA', 'EXTENDED METADATA', 'GET DATA VIA DIRECT ACCESS', 'GET RELATED VISUALIZATION', 'VIEW RELATED INFORMATION']
)
s3_urls = self._get_access_urls(self._url_types)
return [url for url in s3_urls if url.startswith('s3://')]

def _get_additional_urls(self) -> List[str]:
Expand Down

0 comments on commit d38ec84

Please sign in to comment.