···
@state() private uploadComplete = false;
@state() private uploadedTranscriptionId: string | null = null;
@state() private submitting = false;
+
@state() private selectedDate: string = "";
static override styles = css`
···
···
this.uploadComplete = false;
this.uploadedTranscriptionId = null;
+
this.selectedDate = "";
if (this.selectedFile && this.classId) {
+
// Set initial date from file
+
const fileDate = new Date(this.selectedFile.lastModified);
+
this.selectedDate = fileDate.toISOString().split("T")[0] || "";
// Start both detection and upload in parallel
this.detectMeetingTime();
this.startBackgroundUpload();
···
private async detectMeetingTime() {
+
if (!this.classId) return;
this.detectingMeetingTime = true;
const formData = new FormData();
formData.append("class_id", this.classId);
+
// Use selected date or file's lastModified timestamp
+
if (this.selectedDate) {
+
// Convert YYYY-MM-DD to timestamp (noon local time to avoid timezone issues)
+
const date = new Date(`${this.selectedDate}T12:00:00`);
+
timestamp = date.getTime();
+
} else if (this.selectedFile?.lastModified) {
+
timestamp = this.selectedFile.lastModified;
+
formData.append("file_timestamp", timestamp.toString());
const response = await fetch("/api/transcriptions/detect-meeting-time", {
···
private handleMeetingTimeSelect(meetingTimeId: string) {
this.selectedMeetingTimeId = meetingTimeId;
+
private handleDateChange(e: Event) {
+
const input = e.target as HTMLInputElement;
+
this.selectedDate = input.value;
+
// Re-detect meeting time when date changes
+
if (this.selectedDate && this.classId) {
+
this.detectMeetingTime();
private handleSectionChange(e: Event) {
···
this.uploadedTranscriptionId = null;
+
this.selectedDate = "";
this.dispatchEvent(new CustomEvent("close"));
···
+
<label for="date">Recording Date</label>
+
.value=${this.selectedDate}
+
@change=${this.handleDateChange}
+
?disabled=${this.uploading}
+
style="padding: 0.75rem; border: 1px solid var(--secondary); border-radius: 4px; font-size: 0.875rem; color: var(--text); background: var(--background);"
+
<div class="help-text">
+
Change the date to detect the correct meeting time
+
<div class="form-group">
<label>Meeting Time</label>
this.detectingMeetingTime
···
+
this.sections.length > 0 && this.selectedFile
+
<label for="section">Section</label>
@change=${this.handleSectionChange}
?disabled=${this.uploading}
+
.value=${this.selectedSectionId || this.userSection || ""}
<option value="">Use my section ${this.userSection ? `(${this.sections.find((s) => s.id === this.userSection)?.section_number})` : ""}</option>
+
.filter((section) => section.id !== this.userSection)
<option value=${section.id}>${section.section_number}</option>
+
Select which section this recording is for (defaults to your section)
···
<button class="btn-cancel" @click=${this.handleClose} ?disabled=${this.uploading || this.submitting}>
+
this.uploadComplete && this.selectedMeetingTimeId
<button class="btn-upload" @click=${this.handleSubmit} ?disabled=${this.submitting}>
${this.submitting ? "Submitting..." : "Confirm & Submit"}