From 32e75b17c0d7f7f5e1a8748802f2dae44989c21a Mon Sep 17 00:00:00 2001 From: Nico Athanassiadis Date: Fri, 7 Feb 2025 09:50:36 +0100 Subject: [PATCH 1/5] Testing matomo webanalytics Adding some web-analytics for statistics purposes --- src/main/resources/templates/file-management.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/resources/templates/file-management.html b/src/main/resources/templates/file-management.html index b32d62b..03d489a 100644 --- a/src/main/resources/templates/file-management.html +++ b/src/main/resources/templates/file-management.html @@ -7,6 +7,21 @@ + + +
-- 2.39.5 From 4b9ea7b14826b22a43480259d52871ee83af0024 Mon Sep 17 00:00:00 2001 From: Nico Athanassiadis Date: Fri, 7 Feb 2025 10:01:15 +0100 Subject: [PATCH 2/5] Changes in the matomo script --- src/main/resources/templates/file-management.html | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/resources/templates/file-management.html b/src/main/resources/templates/file-management.html index 03d489a..c0920fd 100644 --- a/src/main/resources/templates/file-management.html +++ b/src/main/resources/templates/file-management.html @@ -7,21 +7,16 @@ - + - +
-- 2.39.5 From c14c38bf3f126226d289a9d9019803f9a5412277 Mon Sep 17 00:00:00 2001 From: Nico Athanassiadis Date: Fri, 7 Feb 2025 11:18:43 +0100 Subject: [PATCH 3/5] Will not use matomo Decided to not use matomo for analytics. The application is a single page. Any statistics we want we can parse from the logs. An issue #16 has been added to make the logs more parse friendly. --- src/main/resources/templates/file-management.html | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/main/resources/templates/file-management.html b/src/main/resources/templates/file-management.html index c0920fd..b32d62b 100644 --- a/src/main/resources/templates/file-management.html +++ b/src/main/resources/templates/file-management.html @@ -7,16 +7,6 @@ - - -
-- 2.39.5 From 5eeca0dcd0695fdd712e2ad4bd076a0fc28e5278 Mon Sep 17 00:00:00 2001 From: Nico Athanassiadis Date: Fri, 7 Feb 2025 11:33:12 +0100 Subject: [PATCH 4/5] Do not log transcribed text from whisper Turning off the verbose mode when calling whisper process. This should fix issue #17 --- src/main/java/se/su/dsv/seshat/services/Transcriber.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/se/su/dsv/seshat/services/Transcriber.java b/src/main/java/se/su/dsv/seshat/services/Transcriber.java index e8011a2..e7a93ac 100644 --- a/src/main/java/se/su/dsv/seshat/services/Transcriber.java +++ b/src/main/java/se/su/dsv/seshat/services/Transcriber.java @@ -47,7 +47,9 @@ public class Transcriber { .append(" --output_dir ") .append(outputDirectory) .append(" --device ") - .append(selectedDevice); + .append(selectedDevice) + .append(" --verbose ") + .append("False"); if(language != null && !language.equalsIgnoreCase("auto")) { whisperCommandOptions.append(" --language ") .append(language); -- 2.39.5 From af439dda324e5da0a3bf84c6dc1fcaf155c6deee Mon Sep 17 00:00:00 2001 From: Nico Athanassiadis Date: Sun, 9 Feb 2025 15:45:04 +0100 Subject: [PATCH 5/5] Ensure that jobs are enqueued after application restart. Jobs that are in state of PROCESSING or PENDING will be enqueued after application restart so users that have had an uploaded file in PROCESSING or PENDING do not need to manually re-upload the files again. --- .../seshat/services/JobProcessorService.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main/java/se/su/dsv/seshat/services/JobProcessorService.java b/src/main/java/se/su/dsv/seshat/services/JobProcessorService.java index 35a68be..3472315 100644 --- a/src/main/java/se/su/dsv/seshat/services/JobProcessorService.java +++ b/src/main/java/se/su/dsv/seshat/services/JobProcessorService.java @@ -15,6 +15,7 @@ import se.su.dsv.seshat.repositories.FileMetadataRepository; import java.io.File; import java.time.LocalDateTime; +import java.util.Comparator; import java.util.List; import java.util.Objects; import java.util.concurrent.BlockingQueue; @@ -62,12 +63,21 @@ public class JobProcessorService { worker.start(); } + /** + * Add all jobs that have been in a processing status or pending status + * to the queue when the application starts. + * Ensuring that all jobs are processed even if the application is restarted + * wihtout the user having to re-upload the files. + */ @Transactional public void addPendingJobsToQueue() { - List pendingJobs = fileMetadataRepository.findByJobStatus(JobStatus.PENDING); - for (FileMetadata job : pendingJobs) { - jobQueue.offer(job); - } + List processingJobs = fileMetadataRepository.findByJobStatus(JobStatus.PROCESSING); + processingJobs.addAll(fileMetadataRepository.findByJobStatus(JobStatus.PENDING)); + + processingJobs.sort(Comparator.comparing(FileMetadata::getUploadedAt)); + + processingJobs.forEach(this::addJob); + } @Transactional -- 2.39.5