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

Some sounds are uploaded without a base_filename_slug value #1815

Open
alastair opened this issue Jan 30, 2025 · 0 comments
Open

Some sounds are uploaded without a base_filename_slug value #1815

alastair opened this issue Jan 30, 2025 · 0 comments

Comments

@alastair
Copy link
Member

https://logserver.mtg.upf.edu/organizations/sentry/issues/3695/?

There are a small number of sounds uploaded with a null value for base_filename_slug

In [9]: for s in models.Sound.objects.filter(base_filename_slug__isnull=True).order_by('id'):
   ...:     print(s.id, s.created, s.user)

There are sounds from 2022, 2023, and 2024 so this doesn't appear to be a one-off. This value is used in the sound's __str__, which causes issues in the admin.

The value is set in sound_upload.create_sound(). This method is a bit complex because the value requires the sound to be first saved (to get the id) and then it's updated. It could be that a sound upload failed part-way through, or we have a different flow of creating sounds too.

Importantly, I see that sounds.views.sound_download() uses a different method to get the filename, Sound.friendly_filename(). Even though the documentation for base_filename_slug says that it's used for the download name, but this doesn't seem to be the case. Maybe it's not actually needed.

Options:

  • see if we can work out if there is a different way that sounds are created in some cases
  • see if there is a bug/crash when creating some sounds
  • remove this field and use Sound.friendly_filename()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant