Skip to content

Commit

Permalink
Merge pull request #416 from classtranscribe/Quote-OCR-descriptions
Browse files Browse the repository at this point in the history
Update TaskController.cs
  • Loading branch information
angrave authored Nov 14, 2023
2 parents 7906967 + 6a58369 commit aef7a66
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ClassTranscribeServer/Controllers/TaskController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,23 @@ private void createDescriptionsIfNone(Video v, TextData scenedata)
int index = 0;
foreach (JObject scene in scenes)
{
StringBuilder sb = new StringBuilder();
var again = false;
foreach (string phrase in scene["phrases"])
{
sb.Append(again ? '\n' : '\"' );
sb.Append(phrase);
again = true;
}
sb.Append('\"');

var c = new Caption
{
Index = index++,
Begin = TimeSpan.Parse(scene["start"].ToString()),
End = TimeSpan.Parse(scene["end"].ToString()),
CaptionType = CaptionType.AudioDescription,
Text = scene["phrases"]?.ToString()
Text = sb.ToString()
};

captions.Add(c);
Expand Down Expand Up @@ -236,4 +246,4 @@ public async Task<ActionResult<Object>> GetGlossaryTimestamp(string videoId) {
return NotFound();
}
}
}
}

0 comments on commit aef7a66

Please sign in to comment.