Skip to content

Conversation

@DaniEnsi
Copy link

@DaniEnsi DaniEnsi commented Oct 18, 2025

Motivation and Context

Allows lecturers to upload multiple video lectures at once instead of creating them one-by-one. This significantly improves the workflow when importing a batch of pre-recorded lectures (e.g., uploading an entire semester's worth of recordings).

Description

Adds batch video-on-demand (VOD) upload functionality to the lecture creation form, allowing users to create and upload multiple lectures with individual metadata and video files in a single workflow.

Resolves: #1617

Changes:

  • Add batch lecture management (add/remove rows) in form data
  • Add batch-specific UI in lecture details slide with multiple rows for lecture name and start time
  • Add batch-specific media upload slide showing file inputs for each lecture (COMB/PRES/CAM)
  • Implement batch upload progress tracking with per-lecture status and per-file progress bars
  • Reuse existing createVOD and uploadVODMedia endpoints (no backend changes needed)
  • Include automatic rollback on batch upload failure (deletes all created streams if any upload fails)
  • Add form validation to ensure all lectures have required metadata before proceeding
  • Integrate Flatpickr date/time pickers for batch lecture start times
  • Support mixed upload scenarios (some lectures with only COMB, others with PRES+CAM, etc.)

Steps for Testing

Prerequisites:

  • Lecturer account
  • Access to a course as lecturer
  • Multiple video files (mp4 format recommended) for testing
  1. Log in as lecturer
  2. Navigate to a course management page
  3. Click "Create Lecture" button
  4. Select "Video Upload" option
  5. Enter lecture details for first lecture (name and start time)
  6. Click "Add Another Lecture" button to add more rows
  7. Fill in details for additional lectures (e.g., 3-5 lectures)
  8. Test removing a lecture row using the trash icon
  9. Click "Next" to proceed to media upload
  10. Upload video files (COMB/PRES/CAM) for each lecture
  11. Verify that each lecture shows its own upload section
  12. Click "Submit" and observe:
    • Progress indicator shows "Creating streams" phase
    • Progress indicator shows "Uploading" phase with lecture name and file progress
    • Individual file progress bars update for COMB/PRES/CAM
  13. After completion, verify all lectures appear in the course lecture list
  14. Verify each lecture has correct metadata (name, start time, video files)

Edge cases tested:

  • Try to proceed without filling required fields (should show validation message) - ✅
  • Try to proceed with empty lecture rows (should show validation message) - ✅
  • Test with only 1 lecture (should still work) - ✅
  • Simulate upload failure (turned worker off) and verify rollback (all created lectures are deleted) - ✅

Screenshots

TumLive.Batch.Upload.mp4

- Add new LectureCreateType.batchVodUpload enum for batch mode
- Implement batch lecture management (add/remove rows) in form data
- Add batch-specific UI in lecture details slide with multiple rows
- Add batch-specific media upload slide for each lecture
- Add batch upload progress tracking with per-lecture status
- Reuse existing createVOD and uploadVODMedia endpoints
- Include automatic rollback on batch upload failure
@DaniEnsi
Copy link
Author

Now that I have finished everything I am not sure if this was what you meant by batch upload. I mean this makes it already quicker but how about uploading a folder/zip and allowing the lecturer to change the names afterwards?!

Also just fyi i am pretty new to go, i have decent experience in html (web) but if you have any improvements in general or just style please lmk.

@DaniEnsi DaniEnsi changed the title feat(upload): add batch video upload functionality Add batch video upload functionality Oct 18, 2025
@DaniEnsi DaniEnsi marked this pull request as ready for review October 19, 2025 19:20
@DaniEnsi
Copy link
Author

DaniEnsi commented Nov 4, 2025

@joschahenningsen Könnte jemand mal einen Blick hier drauf werfen, nur dass ich weiß was noch geändert werden soll?

@joschahenningsen
Copy link
Member

Hey Daniel, sorry, deine PR ist mir durchgerutscht! Ich schaue sie mir heute Abend an, vielen dank für die contribution. 🫶

@joschahenningsen joschahenningsen self-requested a review November 4, 2025 10:02
Copy link
Member

@joschahenningsen joschahenningsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You really put lots of effort in this, and I think it's pretty clean! One thing I noticed is, that the "Record Lecture" screen also allows adding multiple lectures, but fails with "All lectures must have a start time!", which it shouldn't.
I'd argue, local recordings should not be possible as batches.

const missingTitle = partialLectures.some((lec) => lec.title.trim().length === 0);
const missingStart = partialLectures.some((lec) => lec.start.trim().length === 0);
if (missingTitle) {
this.cannotContinueReason += "All lectures must have a title!\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a concern for us, actually most lectures don't have a title.

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.

Batch upload

2 participants