mitodl / ocw-studio

Open Source Courseware authoring tool
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

edit video tab data #1143

Open pdpinch opened 2 years ago

pdpinch commented 2 years ago

In https://github.com/mitodl/ocw-data-parser/issues/162 we started importing video metadata that appears below the video player.

That content now publishes on the site, but there's no way to edit it. I was expecting it would be a field in the video metadata, but it's not there.

for example, compare the published page: https://ocwnext.odl.mit.edu/courses/cms-930-media-education-and-the-marketplace-fall-2001/resources/personal-media/

with the studio page: https://ocw-studio.odl.mit.edu/sites/cms-930-media-education-and-the-marketplace-fall-2001/type/resource/edit/112255fb-d8d5-7ec1-580d-0f9e30025109/?q=personal

Acceptance Criteria:

MAbdurrehman12 commented 2 years ago

I think, in ocw-to-hugo we can move

optional_text:          optionalText,
related_resources_text: relatedResourcesText,
optional_tab_title:     media["optional_tab_title"] || "",

from here to/inside video_metadata here while generating front matter in generateResourceMarkdownForVideo

and in ocw-hugo-projects, we can add these fields in video metadata widget here

But since I'm not very sure so if @mbertrand could share his thoughts on this?

mbertrand commented 2 years ago

That sounds right, but I think ocw-hugo-themes would have to change too here

MAbdurrehman12 commented 2 years ago

That sounds right, but I think ocw-hugo-themes would have to change too here

Yes. Thanks for confirming.

@pdpinch Shall we proceed with this then? It will be 3 PRs I think

mbertrand commented 2 years ago

Maybe a simpler way would be to keep the fields where they are and just change ocw-hugo-projects to conditionally add these fields to the form if a video resource, but outside of the video_metadata section. However it seems like the video_metadata section is where they logically belong.

MAbdurrehman12 commented 2 years ago

@pdpinch So after talking to @mbertrand regarding this, it looks like we have 2 approaches (maybe we have more but I'm not sure):

First Approach: (Reference)

  1. In ocw-to-hugo, move these fields (related resource text, optional title, and optional text) inside video-metadata (currently, they are outside) in front-matter
  2. Add these fields in ocw-hugo-projects in video-metadata
  3. Update ocw-hugo-themes to get this data from video-metadata (reference)

With this approach, we will also have to update all the current resources as the location of the fields are being changed.

Second Approach: (Reference)

  1. Conditionally add these fields to the form only for video resources, but outside of the video_metadata section. this approach is much simpler and we will also not have to update the current resources but the data will be outside metadata despite the fact that it logically belongs to metadata.

@mbertrand Please correct me if I'm wrong or If i have missed anything or if you would like to add anything.

gumaerc commented 2 years ago

I think we should go with the second approach. An additional consideration is that these fields were brought into ocw-studio using overwrite_ocw_course_content. I'm unsure if the function supports pulling in a nested field like metadata.video_metadata.optional_text but if we're going to go with the first approach we should make sure that this is supported, as I don't think we can run that with just metadata.video_metadata as it would overwrite video metadata that has been updated by the OCW team. @abeglova might know more.

Really the "Video Metadata" section is all YouTube metadata anyway. Maybe we should rename that section to "YouTube Metadata" and create a new section for these other properties called "Additional Video Metadata" or something? It seems doubtful that this other content (that originally came from the video page in OCW) would ever be directly used in YouTube. If we put all of these properties under something like additional_video_metadata then we could run the overwrite_ocw_course_content command with metadata.additional_video_metadata and in the starter we could define a separate section for these below the YouTube metadata. Anyway, that's my thoughts on it.

pdpinch commented 2 years ago

Can you remind me what the field names are? I don't see them in ocw-hugo-projects (which, perhaps, is part of the problem).

MAbdurrehman12 commented 2 years ago

Can you remind me what the field names are? I don't see them in ocw-hugo-projects

if you're talking about these fields:

  1. optional_text
  2. related_resources_text
  3. optional_tab_title

then I don't think these fields are there in ocw-hugo-projects yet as stated here

pdpinch commented 1 year ago

So far, the few times this has come up, we have simply edited the video "tab data" via the django admin.

There have been no requests to enable this for new videos.