Skip to content

Commit

Permalink
Update TaskController.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
angrave authored Nov 14, 2023
1 parent 7906967 commit 8f18b1d
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();

Check failure on line 106 in ClassTranscribeServer/Controllers/TaskController.cs

View workflow job for this annotation

GitHub Actions / Build

} expected
};

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

Check failure on line 249 in ClassTranscribeServer/Controllers/TaskController.cs

View workflow job for this annotation

GitHub Actions / Build

Type or namespace definition, or end-of-file expected

0 comments on commit 8f18b1d

Please sign in to comment.