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 May 7, 2024
2 parents 6fa2fce + 40cd08e commit 7ffb043
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ class Item {

final var captions = findCaptions(mp);

// Get the generated slide text.
final var slideText = Arrays.stream(mp.getElements())
.filter(mpe -> mpe.getFlavor().eq("mpeg-7/text"))
.map(element -> element.getURI())
.findFirst();

// Obtain duration from tracks, as that's usually more accurate (stores information from
// inspect operations). Fall back to `getDcExtent`.
final var duration = Arrays.stream(mp.getTracks())
Expand Down Expand Up @@ -160,6 +166,8 @@ class Item {
"created", "creator", "title", "extent", "isPartOf", "description", "identifier",
}))),
Jsons.p("captions", Jsons.arr(captions)),
Jsons.p("slideText", slideText.map(t -> t.toString()).orElse(null)),
Jsons.p("segments", Jsons.arr(findSegments(mp))),
Jsons.p("updated", event.getModified().getTime())
);
}
Expand Down Expand Up @@ -323,6 +331,17 @@ private static String findThumbnail(MediaPackage mp) {
.orElse(null);
}

private static List<Jsons.Val> findSegments(MediaPackage mp) {
return Arrays.stream(mp.getAttachments())
.filter(a -> a.getFlavor().getSubtype().equals("segment+preview"))
.map(s -> Jsons.obj(
Jsons.p("uri", s.toString()),
Jsons.p("startTime", s.getReference().getProperty("time"))
)
)
.collect(Collectors.toCollection(ArrayList::new));
}

private static Jsons.Val findTimelinePreview(MediaPackage mp) {
return Arrays.stream(mp.getAttachments())
.filter(a -> a.getFlavor().getSubtype().equals("timeline+preview"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public class TobiraEndpoint {

// Versioning the Tobira API:
//
// Since both Tobira and this API are changing over time, we need some machanism for ensuring they
// Since both Tobira and this API are changing over time, we need some mechanism for ensuring they
// are compatible. We don't want to enforce a 1:1 thing, where a particular Tobira needs one
// exact API as that makes the update process harder (especially once this module is included in
// the community version). So instead we have some semver-like versioning here. Increase the
Expand Down

0 comments on commit 7ffb043

Please sign in to comment.