Skip to content

Commit

Permalink
#2 - Format MBARI deployment id as 4 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
hohonuuli committed Sep 23, 2021
1 parent 965e9f9 commit d2df595
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
18 changes: 9 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
lazy val auth0Version = "3.16.0"
lazy val auth0Version = "3.18.2"
lazy val codecVersion = "1.15"
lazy val configVersion = "1.4.1"
lazy val jettyVersion = "9.4.40.v20210413"
lazy val jettyVersion = "9.4.43.v20210629"
lazy val json4sJacksonVersion = "3.6.11"
lazy val jansiVersion = "1.18"
lazy val jtaVersion = "1.1"
lazy val junitVersion = "4.13.2"
lazy val logbackVersion = "1.3.0-alpha4"
lazy val rxjavaVersion = "3.0.12"
lazy val scalatestVersion = "3.2.8"
lazy val logbackVersion = "1.3.0-alpha10"
lazy val rxjavaVersion = "3.1.1"
lazy val scalatestVersion = "3.2.10"
lazy val scalatraVersion = "2.7.1"
lazy val servletVersion = "4.0.1"
lazy val slf4jVersion = "1.8.0-beta4"
lazy val slf4jVersion = "2.0.0-alpha5"

Global / onChangedBuildSource := ReloadOnSourceChanges

lazy val buildSettings = Seq(
organization := "org.mbari.m3",
scalaVersion := "2.13.5",
crossScalaVersions := Seq("2.13.5"),
scalaVersion := "2.13.6",
crossScalaVersions := Seq("2.13.6"),
organizationName := "Monterey Bay Aquarium Research Institute",
startYear := Some(2017),
licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt"))
Expand Down Expand Up @@ -87,7 +87,7 @@ lazy val `panoptes` = (project in file("."))
.settings(appSettings)
.settings(
name := "panoptes",
version := "0.2.4",
version := "0.2.5",
fork := true,
libraryDependencies ++= Seq(
"com.auth0" % "java-jwt" % auth0Version,
Expand Down
3 changes: 1 addition & 2 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#sbt.version=0.13.15
sbt.version=1.3.13
sbt.version=1.5.4

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ case object UUIDSerializer
UUID.fromString(s)
} catch {
case NonFatal(e) =>
throw MappingException(e.getMessage, new java.lang.IllegalArgumentException(e))
throw new MappingException(e.getMessage, new java.lang.IllegalArgumentException(e))
}
case JNull => null
}, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class MbariDiskArchiver extends DiskArchiver {
} else None
}

override def uri(cameraId: String, deploymentId: String, name: String) = {
override def uri(cameraId: String, deploymentId: String, name: String): URI = {
val uriPath = s"$archiveUrl${relativeFilePath(cameraId, deploymentId)}/$name"
val uriEscaped = uriPath.replace(" ", "%20")
new URL(uriEscaped).toURI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class OldStyleMbariDiskArchiver extends MbariDiskArchiver {
*/
override protected def relativeFilePath(cameraId: String, deploymentId: String): String = {
val parts = deploymentId.split("\\s+")
val diveNumber = Try(parts.last.toInt.toString).getOrElse(deploymentId)
val diveNumber = Try(parts.last.toInt)
.map(s => f"$s%04d")
.getOrElse(deploymentId)
s"$cameraId/images/$diveNumber"
}

Expand Down

0 comments on commit d2df595

Please sign in to comment.