Multi-platform: support multiple files per version #201
@ -757,14 +757,13 @@ class Version(CreatedModifiedMixin, TrackChangesMixin, models.Model):
|
||||
|
||||
def _get_download_name(self, platform=None) -> str:
|
||||
"""Return a file name for downloads."""
|
||||
replace_char = f'{self}'.replace('.', '-')
|
||||
parts = [self.extension.type_slug_singular, self.extension.slug, f'v{self.version}']
|
||||
if platform:
|
||||
return f'{utils.slugify(replace_char)}.{platform}.zip'
|
||||
else:
|
||||
return f'{utils.slugify(replace_char)}.zip'
|
||||
parts.append(platform)
|
||||
return f'{"-".join(parts)}.zip'
|
||||
|
||||
def get_download_url(self, platform=None, append_repository_and_compatibility=True) -> str:
|
||||
filename = f'{self.extension.type_slug_singular}-{self.extension.slug}-v{self.version}.zip'
|
||||
filename = self._get_download_name(platform=platform)
|
||||
if platform:
|
||||
download_url = reverse(
|
||||
'extensions:version-platform-download',
|
||||
|
Loading…
Reference in New Issue
Block a user