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

feat: Add upload audio and subtitle functionality #34

Merged
merged 9 commits into from
Jul 25, 2024

Conversation

unna97
Copy link
Owner

@unna97 unna97 commented Jul 14, 2024

This commit adds the functionality to upload both audio and subtitle files simultaneously. It includes changes to the urls.py file to add a new URL pattern for uploading audio and subtitle files. Additionally, a new HTML template upload_audio_subtitle.html is created to display the form for uploading the files. The utils.py file is also modified to include a new function process_subtitle_file that processes the uploaded subtitle file and returns a list of subtitle dictionaries.

The commit also includes database migrations to alter the start_time and end_time fields of the Subtitle model to use DurationField instead of TimeField. This change allows for more accurate representation of subtitle timings.

Lastly, the models.py file is updated to include the Subtitle model with the necessary fields and relationships.

Description

Motivation and Context

How Has This Been Tested?

Dependencies Added:

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • I have added tests to cover my changes.

unna97 added 9 commits July 14, 2024 19:44
This commit adds the functionality to upload both audio and subtitle files simultaneously. It includes changes to the `urls.py` file to add a new URL pattern for uploading audio and subtitle files. Additionally, a new HTML template `upload_audio_subtitle.html` is created to display the form for uploading the files. The `utils.py` file is also modified to include a new function `process_subtitle_file` that processes the uploaded subtitle file and returns a list of subtitle dictionaries.

The commit also includes database migrations to alter the `start_time` and `end_time` fields of the `Subtitle` model to use `DurationField` instead of `TimeField`. This change allows for more accurate representation of subtitle timings.

Lastly, the `models.py` file is updated to include the `Subtitle` model with the necessary fields and relationships.
This commit removes unused imports from the `views.py` file. The removal of unused imports helps improve code readability and maintainability.
This commit removes unused imports from the `views.py` file to improve code readability and maintainability. Additionally, it updates the upload functionality to allow for simultaneous uploading of audio and subtitle files. Changes include modifying the `urls.py` file to add a new URL pattern for uploading audio and subtitle files, creating a new HTML template `upload.html` to display the upload form, and updating the `UploadAudioAndSubtitleView` class in `views.py` to handle the new functionality.
This commit updates the `annotate.html` template to display subtitles for the audio file. It adds a new section with a heading "Subtitles" and iterates over the `subtitles` variable to display each subtitle. If the subtitle content is longer than 20 characters (this is a dummy temporary function), it is highlighted using the `highlight_text` class. This change improves the user experience by providing the ability to view and interact with subtitles while annotating the audio file.
This commit updates the background color and padding in the `style.css` file. The background color is changed to `#CACDBB` and the padding for table cells is adjusted to `10px 7px`. These changes improve the visual appearance and spacing of the table in the web page.
@unna97 unna97 merged commit 9af92a8 into main Jul 25, 2024
2 checks passed
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.

1 participant