thunderstore-io / Thunderstore

Thunderstore is a mod database and API for downloading mods. Thunderstore Discord: https://discord.thunderstore.io/
https://thunderstore.io/
GNU Affero General Public License v3.0
135 stars 27 forks source link

Add option to reuse PackageVersion icon on test data creation #1050

Closed anttimaki closed 2 months ago

anttimaki commented 2 months ago

Reusing the same image means we don't need to upload so many images to S3 bucket (or multiple buckets if mirrors are configured), significantly speeding up creating larger data sets.

The implementation reuses the path of the first created image, which uses the team-package-version naming pattern, instead of using something more descriptive like "default.png". Bypassing the generated name would have required hacky stuff for the function that calculates the value for ImageField's upload_to attribute, or the models save method. As this would make it theoretically possible to things go wrong in the production, it was deemed better to just use the misleading image name in test environments.