- make text tracks always a json array

This commit is contained in:
Richard Alam 2018-06-29 13:42:59 -07:00
parent 6401bf905d
commit f62c872353
2 changed files with 15 additions and 7 deletions

View File

@ -17,11 +17,20 @@ case class UploadedTrackInfo(recordId: String,
lang: String,
label: String,
origFilename: String)
case class Track(kind: String, lang: String, label: String, source: String, href: String)
case class Tracks(tracks: util.ArrayList[Track])
case class GetRecTextTracksResult(returncode: String, tracks: Tracks)
case class Track(kind: String,
lang: String,
label: String,
source: String,
href: String)
case class GetRecTextTracksResult(returncode: String,
tracks: util.ArrayList[Track])
case class GetRecTextTracksResp(response: GetRecTextTracksResult)
case class GetRecTextTracksResultFailed(returncode: String, messageKey: String, message: String)
case class GetRecTextTracksResultFailed(returncode: String,
messageKey: String,
message: String)
case class GetRecTextTracksRespFailed(response: GetRecTextTracksResultFailed)
case class PutRecTextTrackResult(returncode: String, recordId: String, messageKey: String, message: String)
case class PutRecTextTrackResult(returncode: String,
recordId: String,
messageKey: String,
message: String)
case class PutRecTextTrackResp(response: PutRecTextTrackResult)

View File

@ -192,8 +192,7 @@ class RecMetaXmlHelper extends RecordingServiceGW with LogHelper {
readCaptionJsonFile(captionsFilePath, StandardCharsets.UTF_8) match {
case Some(captions) =>
val ctracks = gson.fromJson(captions, classOf[util.ArrayList[Track]])
val xtracks = Tracks(ctracks)
val result1 = GetRecTextTracksResult(SUCCESS, xtracks)
val result1 = GetRecTextTracksResult(SUCCESS, ctracks)
val response1 = GetRecTextTracksResp(result1)
val respText1 = gson.toJson(response1)