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

Import rar/zip and csv for project tasks #26

Open
IoannisSina opened this issue Jul 27, 2021 · 6 comments
Open

Import rar/zip and csv for project tasks #26

IoannisSina opened this issue Jul 27, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request Extension of back-end features Add feature to the back-end Extension of front-end features Add feature to the front-end

Comments

@IoannisSina
Copy link
Collaborator

Now only a single file can be uploaded. This issue aims to enable the user upload a zip/rar file of audio files or a csv of comma separated urls.

@IoannisSina IoannisSina added enhancement New feature or request Extension of back-end features Add feature to the back-end Extension of front-end features Add feature to the front-end labels Jul 27, 2021
@IoannisSina IoannisSina self-assigned this Jul 27, 2021
@SwagatSBhuyan
Copy link

Hello, I am new to contributing to open source, and am definitely new to this repository. Some guidance would be appreciated but I feel I will be able to tackle this issue.

@IoannisSina
Copy link
Collaborator Author

IoannisSina commented Nov 14, 2021

Hello, in this issue I need a user to be able to upload a zip or rar file consisting of songs (mp3, mp4, wav). I want to process this file in Django (backend), extract it and save all songs in the database. I was able to achieve this when user uploaded a zip file with the following code:

archive = ZipFile(compressed_file, 'r') # read Zip file
files_names = archive.namelist() # take the names of all files
for filename in files_names:
      new_file = archive.open(filename, 'r')

So the new_file contains the song and I am able to save it to the Database.

I have tried many ways to achieve the same thing with a rar file but an error occurs every time I try.

You can check helpers.py file to see the code. It's in the add_tasks_from_compressed_file function.

@SwagatSBhuyan
Copy link

Will this issue be requiring hands on Django experience? I am still a novice in backend but I have decent grasp in Python. I will look into the mentioned script for more details. Thanks!

@IoannisSina
Copy link
Collaborator Author

IoannisSina commented Nov 23, 2021

Actually this is a python issue. There is no library available for reading zip files and extract them. I've tried many libraries but none of them works.

@SwagatSBhuyan
Copy link

But, there are libraries that can read rar files right (as far as I know)? Maybe we can find a really handy API out there that graciously converts the zip to rar while uploading, and then we can easily manipulate and work with the rar file in the Django backend. Can this work?

@IoannisSina
Copy link
Collaborator Author

I have already tried this solution. I was not able to find a suitable API. Also I don't know if this solution is ok when talking for time complexity. If you have a suitable API we can try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Extension of back-end features Add feature to the back-end Extension of front-end features Add feature to the front-end
Projects
None yet
Development

No branches or pull requests

2 participants