-
Notifications
You must be signed in to change notification settings - Fork 397
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 session recordings #8218
base: main
Are you sure you want to change the base?
Conversation
ietf/meeting/views.py
Outdated
today = datetime.datetime.now() | ||
initial = {'title': f"Video recording for {session.group.acronym} on {today.strftime('%b-%d-%Y at %H:%M:%S')}"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Video recording for tools on 2024-10-15 at 18:00:00
. We should probably suggest a title of that form - @rjsparks
Done. Do timezones matter? Should it be UTC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what the existing TZ convention (if any) is, but I think UTC is the right choice. I'd probably add "... UTC" to the default name, though it'd mean a break from existing filename convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why today?
The recording is for a working group session and the times should be the times for that session, not the time of the upload of the recording.
We should consider capturing the moment of "upload" (really, setting a URL) as a docevent, but I don't think we're currently doing that when meetecho reports uploads to youtube, so maybe this is a separate issue for improving both.
But yes, we should present in UTC by default - some views offer browser or meeting local time as well - this upload doesn't need to though, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the assumption that session.meeting.date
is already UTC. Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly, I don't think so, it'll be the date in the meeting timezone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meeting.start_datetime()
will give you a timezone-aware midnight in the meeting timezone. If you have a Session
(which I think you do), then the way to get the formatted start time of that session is:
session.official_timeslotassignment().timeslot.utc_start_time().strftime(...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this needs a guard against official_timeslotassignment()
not existing unless it's guaranteed to exist. It should exist for anything that is on an agenda.
if delete: | ||
delete_recording(pk=delete, session=session) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should think through what a chair would do if they entered the wrong link and wanted to fix it. @rjsparks
I've added a delete button. Is that ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the 'Revision' column is that valid for recordings? How would someone update the revision of a recording anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's valid as long as we're modeling recordings as Document objects.
To date, we have not revised a recording document. Doesn't mean we couldn't (with the current model anyhow). An -01 for youtube would just point to a different URL the same as an -01 for a draft points to a different filename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on the delete button? Should it have a confirmation modal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to assume we need a confirmation modal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. It looks like this. I did it in plain JS with a <dialog>
rather than Bootstrap as we're looking to migrate away from that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have minor heartburn that we're allowing a Document object to be deleted. It violates an assumption about what Document objects are for, but I suppose we have that problem with these recording documents-that-are-just-external-links already and some future project should migrate them to some other model instead.
I'll request one change and we can move forward with this.
… delete recording
ietf/meeting/views.py
Outdated
initial = { | ||
'title': f"Video recording for {session.group.acronym} on {session.meeting.date.strftime('%b-%d-%Y at %H:%M:%S')}" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more concrete about my comments elsewhere, I think something like this is what is needed. The assertion()
call is not bulletproof, there'll still be a 500 if this comes up.
initial = { | |
'title': f"Video recording for {session.group.acronym} on {session.meeting.date.strftime('%b-%d-%Y at %H:%M:%S')}" | |
} | |
timeslot = session.official_timeslotassignment() | |
assertion("timeslot is not None") | |
initial = { | |
'title': f"Video recording for {session.group.acronym} on {timeslot.utc_start_time().strftime('%b-%d-%Y at %H:%M:%S')}" | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed I botched the timeslotassignment.timeslot
step - glad you caught it!
</table> | ||
</form> | ||
<dialog id="delete_confirm_dialog"> | ||
<p>Really delete <a href="#" id="delete_confirm_link"></a>?</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we say Really delete the link to
instead? We don't want to leave anyone with the impression that this will remove the recording at youtube.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8218 +/- ##
==========================================
+ Coverage 88.78% 88.90% +0.11%
==========================================
Files 296 303 +7
Lines 41320 41322 +2
==========================================
+ Hits 36687 36738 +51
+ Misses 4633 4584 -49 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will work now (and it seems fine with manual testing). We need CI tests though.
delete = request.POST.get('delete', False) | ||
if delete: | ||
delete_recording(pk=delete, session=session) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to utilize the form framework here to get back a Document instead of a pk. As written, I think a malicious post could delete an arbitrary document.
''' | ||
document = Document.objects.filter(pk=pk, group=session.group).first() | ||
if document: | ||
document.delete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what caught my eye. This function would be better accepting a Document object rather than a pk, and perhaps should live in the Session model so that the connection to Session is naturally enforced.
This is a suggestion following up @rjsparks' comments inline regarding deletion of the I think the "Delete the link to..." action should delete the When deleting the As far as pk vs instances, I don't think the modeling will let us use |
This particular view isn't using a js frontend. |
Ah, I guess I'd mixed it up with work in other PRs. In that case we might want to use a formset |
Replaces #8084