Skip to content

Commit

Permalink
Merge pull request #3 from Engerrs/master
Browse files Browse the repository at this point in the history
Fix ODS Harvester Resources
  • Loading branch information
smotornyuk authored Oct 23, 2024
2 parents 5e9e8ea + 9571e32 commit b0241c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ckanext/harvest_basket/harvesters/ods_harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ def _fetch_resources(self, source_url, resource_urls, pkg_data):
"name"
] = f"{pkg_data.get('title', tk._('Unnamed resource'))} ({res['rel']})"

# Try to create unique ID that won't be changed over time
resource['id'] = self._generate_unique_id(pkg_data['id'] + resource["format"], resource["url"])

resources.append(resource)

# attachments are an additional resources that we can fetch
Expand All @@ -168,6 +171,9 @@ def _fetch_resources(self, source_url, resource_urls, pkg_data):
resource["format"] = self._guess_attachment_format(att)
resource["name"] = att.get("title", "")

# Try to create unique ID that won't be changed over time
resource['id'] = self._generate_unique_id(pkg_data['id'] + resource["format"], resource["url"])

resources.append(resource)
return resources

Expand Down

0 comments on commit b0241c9

Please sign in to comment.