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

More taskengine updates #469

Merged
merged 2 commits into from
Jan 27, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ClassTranscribeServer/Controllers/CaptionsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public async Task<ActionResult<Caption>> PostCaption(Caption modifiedCaption)
};
_context.Captions.Add(newCaption);
await _context.SaveChangesAsync();
_wakeDownloader.UpdateVTTFile(oldCaption.TranscriptionId);
// nope _wakeDownloader.UpdateVTTFile(oldCaption.TranscriptionId);
return newCaption;
}

Expand Down Expand Up @@ -337,7 +337,7 @@ public async Task<ActionResult<IEnumerable<Caption>>> PostCaptionFile(IFormFile
await _context.Captions.AddRangeAsync(captions);
await _context.SaveChangesAsync();

_wakeDownloader.UpdateVTTFile(transcription.Id);
//nope _wakeDownloader.UpdateVTTFile(transcription.Id);

return captions;
}
Expand Down
18 changes: 9 additions & 9 deletions ClassTranscribeServer/Utils/WakeDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public virtual void UpdatePlaylist(string playlistId)
Wake(msg);
}

public virtual void UpdateVTTFile(string transcriptionId)
{
JObject msg = new JObject
{
{ "Type", TaskType.GenerateVTTFile.ToString() },
{ "TranscriptionId", transcriptionId }
};
Wake(msg);
}
// public virtual void UpdateVTTFile(string transcriptionId)
// {
// JObject msg = new JObject
// {
// { "Type", TaskType.GenerateVTTFile.ToString() },
// { "TranscriptionId", transcriptionId }
// };
// Wake(msg);
// }

public void UpdateOffering(string offeringId)
{
Expand Down
5 changes: 4 additions & 1 deletion TaskEngine/Tasks/DownloadPlaylistInfoTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected override async Task OnConsume(string playlistId, TaskParameters taskPa
} catch(Exception) {
// ignored (e.g. no media). Tried DefaultIfEmpty but that threw an Entity Framework runtime error; hence this slightly clunky exception implementation
}
GetLogger().LogInformation($"Playlist {playlistId}: Starting index = {index}");
GetLogger().LogInformation($"Playlist {playlistId}: Starting index={index}, SourceType={playlist.SourceType}");
List<Media> medias = new List<Media>();
switch (playlist.SourceType)
{
Expand Down Expand Up @@ -105,6 +105,7 @@ public async Task<List<Media>> GetKalturaPlaylist(Playlist playlist, int index,
CTGrpc.JsonString jsonString = null;
try
{
GetLogger().LogError($"playlist=({playlist.Id}):GetKalturaChannelEntriesRPCAsync({playlist.PlaylistIdentifier}) - rpc starting");
jsonString = await _rpcClient.PythonServerClient.GetKalturaChannelEntriesRPCAsync(new CTGrpc.PlaylistRequest
{
Url = playlist.PlaylistIdentifier
Expand All @@ -121,6 +122,8 @@ public async Task<List<Media>> GetKalturaPlaylist(Playlist playlist, int index,
GetLogger().LogError($"playlist=({playlist.Id}):{e.Message}");
}
return newMedia;
} finally {
GetLogger().LogError($"playlist=({playlist.Id}):GetKalturaChannelEntriesRPCAsync({playlist.PlaylistIdentifier}) - rpc complete");
}
JArray jArray = JArray.Parse(jsonString.Json);

Expand Down
2 changes: 1 addition & 1 deletion UnitTests/GlobalFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public GlobalFixture()
Directory.CreateDirectory(_testDataDirectory);

var mockWake = new Mock<WakeDownloader>(MockBehavior.Strict, null);
mockWake.Setup(wake => wake.UpdateVTTFile(It.IsAny<string>()));
// mockWake.Setup(wake => wake.UpdateVTTFile(It.IsAny<string>()));
mockWake.Setup(wake => wake.UpdatePlaylist(It.IsAny<string>()));
mockWake.Setup(wake => wake.SceneDetection(It.IsAny<string>(), It.IsAny<bool>()));

Expand Down
Loading