bug: fix the finish scan event
This commit is contained in:
parent
66aa064e2f
commit
b11aac2857
@ -72,7 +72,7 @@ public class AutoScanApp
|
|||||||
.AddJob(downloaderJob)
|
.AddJob(downloaderJob)
|
||||||
.AddJob(scannerJob)
|
.AddJob(scannerJob)
|
||||||
.AddJob(cleanJob)
|
.AddJob(cleanJob)
|
||||||
.OnFinish(OnScanCompleted)
|
.OnFinish(() => OnScanCompleted?.Invoke() ?? Task.CompletedTask)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
_scheduler.ListenerManager.AddJobListener(chainer, GroupMatcher<JobKey>.GroupEquals(GROUP_NAME));
|
_scheduler.ListenerManager.AddJobListener(chainer, GroupMatcher<JobKey>.GroupEquals(GROUP_NAME));
|
||||||
@ -99,7 +99,7 @@ public class AutoScanApp
|
|||||||
|
|
||||||
public string? GetVideoPath(string name)
|
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))
|
if (!File.Exists(path))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
@ -66,7 +66,7 @@ public class DVRScanner : IDVRScanner
|
|||||||
_logger.LogDebug("DVR Process started with ID: {Id}", process.Id);
|
_logger.LogDebug("DVR Process started with ID: {Id}", process.Id);
|
||||||
|
|
||||||
await UpdateProcessUntilExits(process, cancellationToken);
|
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
|
//Count the number of .avi files and .jpg files in the detection folder
|
||||||
var aviFiles = Directory.GetFiles(_options.Scanner.DetectionFolder!, "*.avi");
|
var aviFiles = Directory.GetFiles(_options.Scanner.DetectionFolder!, "*.avi");
|
||||||
|
@ -56,7 +56,11 @@ public class ChainerListener : JobListenerSupport
|
|||||||
if (_chainLinks.ContainsValue(context.JobDetail.Key))
|
if (_chainLinks.ContainsValue(context.JobDetail.Key))
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Job '{JobKey}' is the last in the chain", context.JobDetail.Key);
|
_logger.LogInformation("Job '{JobKey}' is the last in the chain", context.JobDetail.Key);
|
||||||
if (OnJobChainFinished is not null)
|
if (OnJobChainFinished is null)
|
||||||
|
{
|
||||||
|
_logger.LogWarning("There is no OnJobChainFinished event to trigger");
|
||||||
|
return;
|
||||||
|
}
|
||||||
await OnJobChainFinished.Invoke();
|
await OnJobChainFinished.Invoke();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -46,8 +46,8 @@ output-dir = .\media\detected
|
|||||||
|
|
||||||
# Method of generating output videos. Possible values are: SCAN_ONLY, OPENCV,
|
# Method of generating output videos. Possible values are: SCAN_ONLY, OPENCV,
|
||||||
# FFMPEG, COPY. Not all features are supported in FFMPEG/COPY mode.
|
# FFMPEG, COPY. Not all features are supported in FFMPEG/COPY mode.
|
||||||
#output-mode = OPENCV
|
|
||||||
output-mode = OPENCV
|
output-mode = OPENCV
|
||||||
|
#output-mode = COPY
|
||||||
|
|
||||||
|
|
||||||
# Arguments to add before the input when calling ffmpeg in output-mode FFMPEG
|
# Arguments to add before the input when calling ffmpeg in output-mode FFMPEG
|
||||||
|
Loading…
Reference in New Issue
Block a user