diff --git a/src/CasaBot/AutoScan/AutoScanApp.cs b/src/CasaBot/AutoScan/AutoScanApp.cs index 3364ce7..691dd41 100644 --- a/src/CasaBot/AutoScan/AutoScanApp.cs +++ b/src/CasaBot/AutoScan/AutoScanApp.cs @@ -72,7 +72,7 @@ public class AutoScanApp .AddJob(downloaderJob) .AddJob(scannerJob) .AddJob(cleanJob) - .OnFinish(OnScanCompleted) + .OnFinish(() => OnScanCompleted?.Invoke() ?? Task.CompletedTask) .Build(); _scheduler.ListenerManager.AddJobListener(chainer, GroupMatcher.GroupEquals(GROUP_NAME)); @@ -99,7 +99,7 @@ public class AutoScanApp public string? GetVideoPath(string name) { - var path = Path.Combine(_options.Scanner.DetectionFolder, name + ".avi"); + var path = Path.Combine(_options.Scanner.DetectionFolder, name + ".mp4"); if (!File.Exists(path)) { return null; diff --git a/src/CasaBot/AutoScan/Implementations/DVRScanner.cs b/src/CasaBot/AutoScan/Implementations/DVRScanner.cs index 9d1b0c8..ab2852b 100644 --- a/src/CasaBot/AutoScan/Implementations/DVRScanner.cs +++ b/src/CasaBot/AutoScan/Implementations/DVRScanner.cs @@ -66,7 +66,7 @@ public class DVRScanner : IDVRScanner _logger.LogDebug("DVR Process started with ID: {Id}", process.Id); await UpdateProcessUntilExits(process, cancellationToken); - _logger.LogInformation("Videos scanned successfully!"); + _logger.LogInformation("Videos scanned successfully after {Duration}", DateTime.Now - _startedAt);; //Count the number of .avi files and .jpg files in the detection folder var aviFiles = Directory.GetFiles(_options.Scanner.DetectionFolder!, "*.avi"); diff --git a/src/CasaBot/AutoScan/Listener/ChainerListener.cs b/src/CasaBot/AutoScan/Listener/ChainerListener.cs index 0dab405..4a39b90 100644 --- a/src/CasaBot/AutoScan/Listener/ChainerListener.cs +++ b/src/CasaBot/AutoScan/Listener/ChainerListener.cs @@ -56,8 +56,12 @@ public class ChainerListener : JobListenerSupport if (_chainLinks.ContainsValue(context.JobDetail.Key)) { _logger.LogInformation("Job '{JobKey}' is the last in the chain", context.JobDetail.Key); - if (OnJobChainFinished is not null) - await OnJobChainFinished.Invoke(); + if (OnJobChainFinished is null) + { + _logger.LogWarning("There is no OnJobChainFinished event to trigger"); + return; + } + await OnJobChainFinished.Invoke(); return; } } diff --git a/src/CasaBot/CasaBotApp/dvr-scan.cfg b/src/CasaBot/CasaBotApp/dvr-scan.cfg index e6397c6..8a37772 100644 --- a/src/CasaBot/CasaBotApp/dvr-scan.cfg +++ b/src/CasaBot/CasaBotApp/dvr-scan.cfg @@ -46,8 +46,8 @@ output-dir = .\media\detected # Method of generating output videos. Possible values are: SCAN_ONLY, OPENCV, # FFMPEG, COPY. Not all features are supported in FFMPEG/COPY mode. -#output-mode = OPENCV output-mode = OPENCV +#output-mode = COPY # Arguments to add before the input when calling ffmpeg in output-mode FFMPEG