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

Add duration to metadata #1048

Closed

Conversation

narickmann
Copy link
Contributor

This should fix #738

@narickmann narickmann added the type:feature-improvement This would improve or enhance an existing feature label Jun 2, 2023
Copy link
Member

@LukasKalbertodt LukasKalbertodt left a comment

Choose a reason for hiding this comment

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

One code style and one semantic thingy.

Comment on lines +643 to +644
const start = new Date();
const end = new Date(start.getTime() + duration * 1000);
Copy link
Member

Choose a reason for hiding this comment

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

This would set the start point to the upload time and the end point to that plus duration, which is not accurate. It would already be better if we would use now as end point and now - duration as start point. But there can still be an arbitrary amount of time between stopping the recording and actually uploading.

It would be better to store the time of when the recording was stopped. And then subtract the duration from that to get the start point.

Interesting bit: due to the fact that the recording can be paused, end - recording_duration is not necessarily the recording start point. So we have the choice between three options:

  • Use the correct start/end points. Pausing means that end - start does NOT equal the video duration.
  • Use correct end point and duration, with start point being wrong if the recording was paused.
  • Use correct start point and duration, with end point being wrong if the recording was paused.

I personally don't care which of these options we choose. But maybe Opencast will break if we take the first option?

(Oh, I just saw Lars mentioned this solution in the original issue. I would probably still say we should use the correct recording stop time.)


useEffect(() => {
if (fullDuration !== undefined) {
dispatch({ type: 'SET_DURATION', value: calcDuration(fullDuration, start, end) });
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
dispatch({ type: 'SET_DURATION', value: calcDuration(fullDuration, start, end) });
dispatch({
type: 'SET_DURATION',
value: (end ?? fullDuration) - (start ?? 0),
});

This should do the same, and this way we can avoid the extra function.

@github-actions github-actions bot added the status:conflicts Conflicts with another pull request or issue label Aug 24, 2023
@github-actions
Copy link

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@LukasKalbertodt
Copy link
Member

Replaced by the rebased version: #1077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:conflicts Conflicts with another pull request or issue type:feature-improvement This would improve or enhance an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add duration to metadata
2 participants