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

chore: bump sipi to rc.7 (DSP-733) #1721

Merged
merged 3 commits into from Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions third_party/versions.bzl
Expand Up @@ -8,10 +8,10 @@ METRICS_VERSION = "4.0.1"

# SIPI - digest takes precedence!
SIPI_REPOSITORY = "daschswiss/sipi"
SIPI_VERSION = "3.0.0-rc.5"
SIPI_VERSION = "3.0.0-rc.7"
SIPI_TAG = "v" + SIPI_VERSION
SIPI_IMAGE = SIPI_REPOSITORY + ":" + SIPI_VERSION
SIPI_IMAGE_DIGEST = "sha256:3a3eba0bb0ba9e3c772012c03fb93c7187e8a1016cc4ee0d975b37920c56ccfa"
SIPI_IMAGE_DIGEST = "sha256:0ae1ca94148c2f159a03390718703625d5262b2c7097baf20579dfceb934f090"

# Jena Fuseki - digest takes precedence!
FUSEKI_REPOSITORY = "stain/jena-fuseki"
Expand Down
Expand Up @@ -236,16 +236,14 @@ class SipiConnector extends Actor with ActorLogging {
*
* @param originalFilename the file's original filename, if known.
* @param originalMimeType the file's original MIME type.
* @param internalMimeType the file's internal MIME type (https://dasch.myjetbrains.com/youtrack/issue/DSP-711).
* @param mimeType the file's internal MIME type (https://dasch.myjetbrains.com/youtrack/issue/DSP-711).
* @param internalMimeType the file's internal MIME type.
* @param width the file's width in pixels, if applicable.
* @param height the file's height in pixels, if applicable.
* @param numpages the number of pages in the file, if applicable.
*/
case class SipiKnoraJsonResponse(originalFilename: Option[String],
originalMimeType: Option[String],
internalMimeType: Option[String],
mimeType: Option[String],
internalMimeType: String,
width: Option[Int],
height: Option[Int],
numpages: Option[Int]) {
Expand All @@ -259,7 +257,7 @@ class SipiConnector extends Actor with ActorLogging {
}

object SipiKnoraJsonResponseProtocol extends SprayJsonSupport with DefaultJsonProtocol {
implicit val sipiKnoraJsonResponseFormat: RootJsonFormat[SipiKnoraJsonResponse] = jsonFormat7(SipiKnoraJsonResponse)
implicit val sipiKnoraJsonResponseFormat: RootJsonFormat[SipiKnoraJsonResponse] = jsonFormat6(SipiKnoraJsonResponse)
}

/**
Expand All @@ -277,20 +275,11 @@ class SipiConnector extends Actor with ActorLogging {
for {
sipiResponseStr <- doSipiRequest(sipiRequest)
sipiResponse: SipiKnoraJsonResponse = sipiResponseStr.parseJson.convertTo[SipiKnoraJsonResponse]

// Workaround for https://dasch.myjetbrains.com/youtrack/issue/DSP-711

internalMimeType: String = sipiResponse.internalMimeType.getOrElse(sipiResponse.mimeType.getOrElse(throw SipiException(s"Sipi returned no internal MIME type in response to $knoraInfoUrl")))

correctedInternalMimeType: String = internalMimeType match {
case "text/comma-separated-values" => "text/csv"
case other => other
}
} yield
GetFileMetadataResponseV2(
originalFilename = sipiResponse.originalFilename,
originalMimeType = sipiResponse.originalMimeType,
internalMimeType = correctedInternalMimeType,
internalMimeType = sipiResponse.internalMimeType,
width = sipiResponse.width,
height = sipiResponse.height,
pageCount = sipiResponse.numpages
Expand Down