Skip to content

Commit 4dfe014

Browse files
Hide the fact that we are duplicating series labels better
Seriously, though: The way series categories work with MCA is broken; cf. #648. This fixes a superficial symptom of that fact, namely #634, but it doesn't address the underlying problem of infinitely duplicating labels. The problem with the old code was that the deleted labels are still included in the response in their undeleted form. This patch just updates them in the response collection in-place.
1 parent 03e1aaf commit 4dfe014

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

opencast-backend/annotation-impl/src/main/java/org/opencast/annotation/impl/persistence/ExtendedAnnotationServiceJpaImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -950,9 +950,7 @@ public List<Label> getLabels(final long categoryId, final Option<Integer> offset
950950

951951
// Update our labels with the labels from the master series category
952952
// Note: Maybe do an actual update instead of delete/create
953-
for (Label label: labels) {
954-
deleteLabel(label);
955-
}
953+
labels.replaceAll(this::deleteLabel);
956954
List<Label> newLabels = new ArrayList<>();
957955
for (Label seriesLabel : seriesCategoryLabels) {
958956
final LabelDto dto = LabelDto.create(some(seriesLabel.getId()), categoryId, seriesLabel.getValue(),

0 commit comments

Comments
 (0)