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

Fix appending task bbox to user bbox in annotation nml upload #8280

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/annotation/nml/NmlParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ class NmlParser @Inject()(datasetDAO: DatasetDAO) extends LazyLogging with Proto
taskBoundingBox: Option[BoundingBox] = if (sharedParsingParameters.isTaskUpload)
parseTaskBoundingBox(parameters \ "taskBoundingBox")
else None
userBoundingBoxes = parseBoundingBoxes(parameters \ "userBoundingBox")
} yield {
var userBoundingBoxes = parseBoundingBoxes(parameters \ "userBoundingBox")
if (!sharedParsingParameters.isTaskUpload) {
parseTaskBoundingBoxAsUserBoundingBox(parameters \ "taskBoundingBox", userBoundingBoxes)
.map(asUserBoundingBox => userBoundingBoxes :+ asUserBoundingBox)
.foreach(asUserBoundingBox => userBoundingBoxes = userBoundingBoxes :+ asUserBoundingBox)
Comment on lines 158 to +163
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The changes to userBoundingBoxes weren't saved. These changes now work close to what the logic was before the #8075 pr. cf:

var taskBoundingBox: Option[BoundingBox] = None
parseTaskBoundingBox(parameters \ "taskBoundingBox", isTaskUpload, userBoundingBoxes).foreach {
case Left(value) => taskBoundingBox = Some(value)
case Right(value) => userBoundingBoxes = userBoundingBoxes :+ value
}

}
NmlParsedParameters(
datasetIdOpt,
Expand Down