Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle weird version strings in download counter for archive.org #340

Merged

Conversation

HebaruSan
Copy link
Member

Problem

The download counter throws this now:

InternetArchive id not found in downloads result: KerbalInfinity-1-0,2 - Pyrox
Traceback (most recent call last):
  File "/home/netkan/.local/lib/python3.10/site-packages/netkan/download_counter.py", line 206, in get_result
    counts[ckan_ident] = counts.get(ckan_ident, 0) + result[ia_ident]['all_time']
KeyError: 'KerbalInfinity-1-0,2 - Pyrox'

Cause

When the mirrorer uploads that mod, the space in the version string is replaced with an underscore to conform to archive.org's rules about identifier formatting (see #307 and #328). But when the download counter looks for it, it's not.

Changes

  • Now mirror_item is migrated from CkanMirror to Ckan along with its dependencies
  • Now we use mirror_item in the download counter to ensure consistent item ids

@HebaruSan HebaruSan added Bug Something isn't working Download counts It's about the download counts gathering mechanism labels Sep 15, 2024
@HebaruSan HebaruSan merged commit da7fe3b into KSP-CKAN:master Sep 15, 2024
3 checks passed
@HebaruSan HebaruSan deleted the fix/download-counts-ia-item-fmt branch September 15, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Download counts It's about the download counts gathering mechanism
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant