From b6f29cbdb1a36b278e28dce7cc69c24c4dd9e6e3 Mon Sep 17 00:00:00 2001 From: Lawrence Angrave Date: Sat, 27 Jan 2024 16:45:09 -0600 Subject: [PATCH 1/2] Comment out GenerateVTT Task --- .../Controllers/CaptionsController.cs | 4 ++-- ClassTranscribeServer/Utils/WakeDownloader.cs | 18 +++++++++--------- UnitTests/GlobalFixture.cs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ClassTranscribeServer/Controllers/CaptionsController.cs b/ClassTranscribeServer/Controllers/CaptionsController.cs index 499e17bc..35d4af13 100644 --- a/ClassTranscribeServer/Controllers/CaptionsController.cs +++ b/ClassTranscribeServer/Controllers/CaptionsController.cs @@ -108,7 +108,7 @@ public async Task> PostCaption(Caption modifiedCaption) }; _context.Captions.Add(newCaption); await _context.SaveChangesAsync(); - _wakeDownloader.UpdateVTTFile(oldCaption.TranscriptionId); + // nope _wakeDownloader.UpdateVTTFile(oldCaption.TranscriptionId); return newCaption; } @@ -337,7 +337,7 @@ public async Task>> PostCaptionFile(IFormFile await _context.Captions.AddRangeAsync(captions); await _context.SaveChangesAsync(); - _wakeDownloader.UpdateVTTFile(transcription.Id); + //nope _wakeDownloader.UpdateVTTFile(transcription.Id); return captions; } diff --git a/ClassTranscribeServer/Utils/WakeDownloader.cs b/ClassTranscribeServer/Utils/WakeDownloader.cs index 9cff435f..b2c939a7 100644 --- a/ClassTranscribeServer/Utils/WakeDownloader.cs +++ b/ClassTranscribeServer/Utils/WakeDownloader.cs @@ -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) { diff --git a/UnitTests/GlobalFixture.cs b/UnitTests/GlobalFixture.cs index ded57e47..1376720a 100644 --- a/UnitTests/GlobalFixture.cs +++ b/UnitTests/GlobalFixture.cs @@ -37,7 +37,7 @@ public GlobalFixture() Directory.CreateDirectory(_testDataDirectory); var mockWake = new Mock(MockBehavior.Strict, null); - mockWake.Setup(wake => wake.UpdateVTTFile(It.IsAny())); + // mockWake.Setup(wake => wake.UpdateVTTFile(It.IsAny())); mockWake.Setup(wake => wake.UpdatePlaylist(It.IsAny())); mockWake.Setup(wake => wake.SceneDetection(It.IsAny(), It.IsAny())); From 217b91a381090e64ac7c10faeab68ef35f93ded2 Mon Sep 17 00:00:00 2001 From: Lawrence Angrave Date: Sat, 27 Jan 2024 16:45:19 -0600 Subject: [PATCH 2/2] More logging --- TaskEngine/Tasks/DownloadPlaylistInfoTask.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TaskEngine/Tasks/DownloadPlaylistInfoTask.cs b/TaskEngine/Tasks/DownloadPlaylistInfoTask.cs index 932b3f3f..a85ae98d 100644 --- a/TaskEngine/Tasks/DownloadPlaylistInfoTask.cs +++ b/TaskEngine/Tasks/DownloadPlaylistInfoTask.cs @@ -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 medias = new List(); switch (playlist.SourceType) { @@ -105,6 +105,7 @@ public async Task> 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 @@ -121,6 +122,8 @@ public async Task> 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);