Skip to content

Commit

Permalink
Merge r/15.x into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lkiesow committed Apr 23, 2024
2 parents fcce0ec + de3a5db commit de460f8
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 8 deletions.
34 changes: 34 additions & 0 deletions docs/guides/admin/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ Changelog
Opencast 15
-----------

### Opencast 15.4

- [[#5738](https://github.com/opencast/opencast/pull/5738)] -
Update (New) Admin UI to 2024-04-10
- [[#5696](https://github.com/opencast/opencast/pull/5696)] -
Mark RPMs as available
- [[#5689](https://github.com/opencast/opencast/pull/5689)] -
Process-smil WOH tag-with-profile configuration does not work depending on the encoding profile suffix configured
- [[#5686](https://github.com/opencast/opencast/pull/5686)] -
Fix editor track selection for updating tags
- [[#5678](https://github.com/opencast/opencast/pull/5678)] -
Remove Spurious Warnings During Build
- [[#5677](https://github.com/opencast/opencast/pull/5677)] -
Fix more JavaDoc
- [[#5675](https://github.com/opencast/opencast/pull/5675)] -
Add synchronous deletion to Search API
- [[#5673](https://github.com/opencast/opencast/pull/5673)] -
Paella7: Avoid opening downloaded video
- [[#5670](https://github.com/opencast/opencast/pull/5670)] -
Make a dynamic OSGi dependency static
- [[#5669](https://github.com/opencast/opencast/pull/5669)] -
Update temporal if empty
- [[#5588](https://github.com/opencast/opencast/pull/5588)] -
Update typescript type definitions in ltitools

### Opencast 15.3

- [[#5669](https://github.com/opencast/opencast/pull/5669)] -
Expand Down Expand Up @@ -497,6 +522,15 @@ Opencast 15
Opencast 14
-----------

### Opencast 14.11

*Released on April 16th, 2024*

- [[#5682](https://github.com/opencast/opencast/pull/5682)] -
Quickfix dangling hard links on cephfs volumes
- [[#5667](https://github.com/opencast/opencast/pull/5667)] -
Fixed NPE on filtering data

### Opencast 14.10

*Released on March 14th, 2024*
Expand Down
4 changes: 2 additions & 2 deletions modules/admin-ui-interface/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<properties>
<opencast.basedir>${project.basedir}/../..</opencast.basedir>
<checkstyle.skip>false</checkstyle.skip>
<interface.url>https://github.com/opencast/opencast-admin-interface/releases/download/2024-01-17/oc-admin-ui-2024-01-17.tar.gz</interface.url>
<interface.sha256>cd96df41bb6821a413d1e7c11a9bb42f6453be59a59bb15e76cf6b90a5686caa</interface.sha256>
<interface.url>https://github.com/opencast/opencast-admin-interface/releases/download/2024-04-10/oc-admin-ui-2024-04-10.tar.gz</interface.url>
<interface.sha256>2b2a8628472b19bfdd8e9cf609beb546c6298e41ff3aecb81e4bdacaf51ccd4e</interface.sha256>
</properties>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,13 @@ private WorkflowOperationResult multiencode(MediaPackage src, WorkflowOperationI
private void tagByProfile(Track track, List<EncodingProfile> profiles) {
String rawfileName = track.getURI().getRawPath();
for (EncodingProfile ep : profiles) {
String suffix = ep.getSuffix();
// #DCE
// Add any character at the beginning of the suffix so that it is properly
// converted in toSafeName (because the regex used there may treat the first
// character differently; the default one does now).
String suffixToSanitize = "X" + ep.getSuffix();
// !! workspace.putInCollection renames the file - need to do the same with suffix
suffix = workspace.toSafeName(suffix);
String suffix = workspace.toSafeName(suffixToSanitize).substring(1);
if (suffix.length() > 0 && rawfileName.endsWith(suffix)) {
track.addTag(ep.getIdentifier());
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,12 @@ private void processSection(Map<Job, JobInformation> encodingJobs, MediaPackage
private void tagByProfile(Track track, List<EncodingProfile> profiles) {
String rawfileName = track.getURI().getRawPath();
for (EncodingProfile ep : profiles) {
String suffix = ep.getSuffix();
// #5687: Add any character at the beginning of the suffix so that it is properly
// converted in toSafeName (because the regex used there may treat the first
// character differently; the default regex currently does).
String suffixToSanitize = "X" + ep.getSuffix();
// !! workspace.putInCollection renames the file - need to do the same with suffix
suffix = workspace.toSafeName(suffix);
String suffix = workspace.toSafeName(suffixToSanitize).substring(1);
if (suffix.length() > 0 && rawfileName.endsWith(suffix)) {
track.addTag(ep.getIdentifier());
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@ void addSynchronously(MediaPackage mediaPackage)
*/
Job deleteSeries(String seriesId) throws SearchException, UnauthorizedException, NotFoundException;

/**
* Immediately removes the given mediapackage from the search service.
*
* @param mediaPackageId
* the mediapackage
* @return <code>true</code> if the mediapackage was deleted
* @throws SearchException
* if deletion failed
*/
boolean deleteSynchronously(String mediaPackageId) throws SearchException;

/**
* Find search results based on the specified query object
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,47 @@ public Response remove(@PathParam("id") String mediaPackageId) throws SearchExce
}
}

@DELETE
@Path("removeSynchronously/{id}")
@Produces(MediaType.APPLICATION_XML)
@RestQuery(
name = "remove",
description = "Removes a mediapackage from the search index.",
pathParameters = {
@RestParameter(
description = "The media package ID to remove from the search index.",
isRequired = true,
name = "id",
type = RestParameter.Type.STRING
)
},
responses = {
@RestResponse(description = "OK", responseCode = HttpServletResponse.SC_OK),
@RestResponse(
description = "The mediapackage could not be delete by you or does not exist",
responseCode = HttpServletResponse.SC_BAD_REQUEST
),
@RestResponse(
description = "There has been an internal error and the mediapackage could not be deleted",
responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR
)
},
returnDescription = "Nothing"
)
public Response removeSynchronously(@PathParam("id") String mediaPackageId) throws SearchException {
try {
boolean removed = searchService.deleteSynchronously(mediaPackageId);
if (removed) {
return Response.ok().build();
} else {
return Response.status(Response.Status.BAD_REQUEST).build();
}
} catch (Exception e) {
logger.info("Unable to remove mediapackage {} from search index: {}", mediaPackageId, e.getMessage());
return Response.serverError().build();
}
}

@DELETE
@Path("/seriesId/{seriesid}")
@Produces(MediaType.APPLICATION_XML)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,28 @@ public Job delete(String mediaPackageId) throws SearchException {
throw new SearchException("Unable to remove " + mediaPackageId + " from a remote search service");
}

/**
* {@inheritDoc}
*
* @see org.opencastproject.search.api.SearchService#deleteSynchronously(java.lang.String)
*/
@Override
public boolean deleteSynchronously(String mediaPackageId) throws SearchException {
HttpDelete del = new HttpDelete("/removeSynchronously/" + mediaPackageId);
HttpResponse response = getResponse(del);
try {
if (response != null) {
logger.info("Removing mediapackage '{}' from a remote search service", mediaPackageId);
return response.getStatusLine().getStatusCode() == HttpStatus.SC_OK;
}
} catch (Exception e) {
throw new SearchException("Unable to remove " + mediaPackageId + " from a remote search service", e);
} finally {
closeConnection(response);
}

throw new SearchException("Unable to remove " + mediaPackageId + " from a remote search service");
}

/**
* {@inheritDoc}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import org.opencastproject.mediapackage.MediaPackageElementFlavor;
import org.opencastproject.mediapackage.MediaPackageElementParser;
import org.opencastproject.mediapackage.MediaPackageException;
import org.opencastproject.mediapackage.MediaPackageReference;
import org.opencastproject.mediapackage.MediaPackageReferenceImpl;
import org.opencastproject.mediapackage.Track;
import org.opencastproject.mediapackage.identifier.IdImpl;
import org.opencastproject.security.api.OrganizationDirectoryService;
Expand Down Expand Up @@ -193,12 +195,15 @@ protected Track processSmil(Job job, Smil smil, String trackParamGroupId) throws
}
MediaPackageElementFlavor sourceTrackFlavor = null;
String sourceTrackUri = null;
MediaPackageReference ref = null;
// get source track metadata
for (SmilMediaParam param : trackParamGroup.getParams()) {
if (SmilMediaParam.PARAM_NAME_TRACK_SRC.equals(param.getName())) {
sourceTrackUri = param.getValue();
} else if (SmilMediaParam.PARAM_NAME_TRACK_FLAVOR.equals(param.getName())) {
sourceTrackFlavor = MediaPackageElementFlavor.parseFlavor(param.getValue());
} else if (SmilMediaParam.PARAM_NAME_TRACK_ID.equals(param.getName())) {
ref = new MediaPackageReferenceImpl("track", param.getValue());
}
}
File sourceFile;
Expand Down Expand Up @@ -411,14 +416,15 @@ protected Track processSmil(Job job, Smil smil, String trackParamGroupId) throws
Track editedTrack = (Track) MediaPackageElementParser.getFromXml(inspectionJob.getPayload());
logger.info("Finished editing track {}", editedTrack);
editedTrack.setIdentifier(newTrackId);
editedTrack.setReference(ref);
if (videoclips.size() > 0) {
editedTrack.setFlavor(new MediaPackageElementFlavor(sourceTrackFlavor.getType(), SINK_FLAVOR_SUBTYPE));
}
if (refElements.size() > 0) {
String extension = FilenameUtils.getExtension(sourceTrackUri);
if (VideoEditorProperties.WEBVTT_EXTENSION.equals(extension)) {
editedTrack.setFlavor(new MediaPackageElementFlavor(sourceTrackFlavor.getType(),
sourceTrackFlavor.getSubtype() + "+" + SINK_FLAVOR_SUBTYPE));
sourceTrackFlavor.getSubtype() + "+" + SINK_FLAVOR_SUBTYPE));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,11 @@ public WorkflowOperationResult resume(WorkflowInstance workflowInstance, JobCont
editedTrack.getIdentifier(), FilenameUtils.getName(editedTrack.getURI().toString()));
editedTrack.setURI(editedTrackNewUri);
for (Track track : sourceTracks) {
if (track.getFlavor().getType().equals(editedTrackFlavor.getType())) {
var reference = editedTrack.getReference();
if (reference == null) {
logger.warn("Edited track {} has no reference track assigned; skip restoring tags.",
editedTrack.getIdentifier());
} else if (track.getIdentifier().equals(reference.getIdentifier())) {
editedTrack.setTags(track.getTags());
mp.addDerived(editedTrack, track);
mpAdded = true;
Expand Down

0 comments on commit de460f8

Please sign in to comment.