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

Add Captions #414

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ClassTranscribeServer/Controllers/TaskController.cs
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@
//Future: [Authorize(Roles = Globals.ROLE_MEDIA_WORKER + "," + Globals.ROLE_ADMIN)]
public async Task<ActionResult> UpdateSceneData(string videoId, JObject scene)
{
string sceneAsString = scene.ToString(0);

Check warning on line 49 in ClassTranscribeServer/Controllers/TaskController.cs

GitHub Actions / Build

In externally visible method 'Task<ActionResult> TaskController.UpdateSceneData(string videoId, JObject scene)', validate parameter 'scene' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument.
Video video = await _context.Videos.FindAsync(videoId);
var existingScenes = video.HasSceneObjectData();

@@ -95,6 +95,8 @@
CaptionType = CaptionType.AudioDescription,
Text = scene["phrases"]?.ToString()
};

captions.Add(c);
}
_logger.LogInformation($"{v.Id}: {index} entries added");
var transcription = new Transcription()
@@ -146,7 +148,7 @@
public async Task<ActionResult> UpdatePhraseHints(string videoId, PhraseHintsDTO phraseHintsDTO)
{
Video video = await _context.Videos.FindAsync(videoId);
string hints = phraseHintsDTO.PhraseHints ?? "";

Check warning on line 151 in ClassTranscribeServer/Controllers/TaskController.cs

GitHub Actions / Build

In externally visible method 'Task<ActionResult> TaskController.UpdatePhraseHints(string videoId, PhraseHintsDTO phraseHintsDTO)', validate parameter 'phraseHintsDTO' is non-null before using it. If appropriate, throw an ArgumentNullException when the argument is null or add a Code Contract precondition asserting non-null argument.

if(video.HasPhraseHints()) {
TextData data = await _context.TextData.FindAsync(video.PhraseHintsDataId);
Loading