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

Copy Mediapackage elements from the publication to mediapackage #3554

Merged
merged 5 commits into from Jun 15, 2022

Conversation

CGreweling
Copy link
Member

@CGreweling CGreweling commented Mar 24, 2022

Since OC11 all publicationchannel metadata ist also stored in the mediapackage.
With this pr it is possible to copy this information from a selected
publication channel to the mediapackage in the workspace.

So it is possible to pull Publication elements to the archive.
You can clone/export/manipulate plublished material without reencoding.

Steps to do in the Workflow for example:

  • woh publication-to-workspace
    -> select elements by tags or flavors
    -> tag elements as archive
  • ingest-download
    -> download these elements to workspace
  • snapshot
    -> archive the elements

What is not implemented

  • wildcards for selection
  • tests
    Im not sure, when i would have time to do this last steps.
    If someone want`s it in as it is, feel free to merge.

Copy link
Member

@lkiesow lkiesow left a comment

Choose a reason for hiding this comment

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

Quick initial review. Did not test this yet.

.forEach(element -> tracks.add(element));
Arrays.stream(publication.get().getTracks())
.filter(element -> configuredSourceFlavors.contains(element.getFlavor()))
.filter(Objects::nonNull)
Copy link
Member

Choose a reason for hiding this comment

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

same here

Suggested change
.filter(Objects::nonNull)

.filter(Objects::nonNull)
.forEach(element -> catalogs.add(element));

catalogs.stream().forEach(mediaPackageElement -> mediaPackageElement.addTag(configuredTargetTagsAsString));
Copy link
Member

Choose a reason for hiding this comment

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

same as above

Collection<MediaPackageElement> catalogs = new ArrayList<MediaPackageElement>();
Arrays.stream(publication.get().getCatalogs())
.filter(element -> element.containsTag(configuredSourceTags))
.filter(Objects::nonNull)
Copy link
Member

Choose a reason for hiding this comment

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

same as above

.forEach(element -> catalogs.add(element));
Arrays.stream(publication.get().getCatalogs())
.filter(element -> configuredSourceFlavors.contains(element.getFlavor()))
.filter(Objects::nonNull)
Copy link
Member

Choose a reason for hiding this comment

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

same as above

Copy link
Member Author

@CGreweling CGreweling left a comment

Choose a reason for hiding this comment

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

Thanks for the review. Besides the Ojects:nonNull.
I adapted your comments.

@CGreweling CGreweling requested review from mtneug and lkiesow June 1, 2022 08:17
@CGreweling CGreweling force-pushed the publication-channel-to-workspace branch from 7ef5726 to ed0e3b1 Compare June 13, 2022 06:46
@CGreweling
Copy link
Member Author

I did a rebase, now Workflow-tests does not fail any more.

tags ar added one by one not as complete string
@CGreweling CGreweling force-pushed the publication-channel-to-workspace branch from ed0e3b1 to b6a523e Compare June 14, 2022 13:01
@CGreweling CGreweling changed the base branch from develop to r/12.x June 14, 2022 13:01
@Arnei
Copy link
Member

Arnei commented Jun 14, 2022

I said I'd review this, but for whatever reason my Opencast can't find the workflow handler, so I can't really test. Code seems fine though.

@lkiesow
Copy link
Member

lkiesow commented Jun 14, 2022

The test failures are likely due to the tests which were broken a few weeks ago. Likely just rebasing or merging the current r/12.x will fix that.

Copy link
Member

@Arnei Arnei left a comment

Choose a reason for hiding this comment

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

Okay, managed to get my Opencast working and now this operation works as advertised.

Still wondering why the .filter(Objects::nonNull) checks are required, but I guess they don't hurt.

The suggestions below are just spelling fixes.

CGreweling and others added 3 commits June 15, 2022 15:33
…o-workspace-woh.md

Co-authored-by: Arne Wilken <Arnei@users.noreply.github.com>
…o-workspace-woh.md

Co-authored-by: Arne Wilken <Arnei@users.noreply.github.com>
…o-workspace-woh.md

Co-authored-by: Arne Wilken <Arnei@users.noreply.github.com>
@Arnei Arnei merged commit 8faf9e7 into opencast:r/12.x Jun 15, 2022
lkiesow added a commit that referenced this pull request Jun 15, 2022
This adds pull request #3554 which got merged in last minute.
lkiesow added a commit that referenced this pull request Jun 15, 2022
This adds pull request #3554 which got merged in last minute.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants