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

Enable upload of different sound files with the same filename #1806

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

quimmrc
Copy link
Contributor

@quimmrc quimmrc commented Dec 16, 2024

Issue(s)
#1181

Description
Sound files uploaded with the same file name got overwritten in the description queue.
In order to solve that, my proposal is to change the filenames adding an index as done in most of OS files handling (for example, for download), e.g.:

a.mp3
a(1).mp3

Deployment steps:
upload() creates a submitted files list, using this list:

  1. Create a new list to store filenames
  2. For each file name, check if the name already exists in the list and if so, give it an index for as many times as the name has already appeared.
  3. Update the filename with the index appropiately

Note: all filenames will be added to the filenames list for indexing purposes (for the duplicated ones, addition must be done before filename modification).

@ffont
Copy link
Member

ffont commented Dec 24, 2024

We should add a unit test for that, you can probably add an extra test method next to this one:

def test_handle_uploaded_file_html(self):

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

Successfully merging this pull request may close these issues.

2 participants