docs: improve logs for dvr scanner
This commit is contained in:
parent
7b33a8043b
commit
620096a7b1
@ -102,7 +102,6 @@ public class AutoScanApp
|
||||
var path = Path.Combine(_options.Scanner.DetectionFolder, name + ".avi");
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
_logger.LogWarning("File {Path} does not exist", path);
|
||||
return null;
|
||||
}
|
||||
return path;
|
||||
|
@ -68,6 +68,11 @@ public class DVRScanner : IDVRScanner
|
||||
await UpdateProcessUntilExits(process, cancellationToken);
|
||||
_logger.LogInformation("Videos scanned successfully!");
|
||||
|
||||
//Count the number of .avi files and .jpg files in the detection folder
|
||||
var aviFiles = Directory.GetFiles(_options.Scanner.DetectionFolder!, "*.avi");
|
||||
var jpgFiles = Directory.GetFiles(_options.Scanner.DetectionFolder!, "*.jpg");
|
||||
_logger.LogInformation("Found {AviCount} .avi files and {JpgCount} .jpg files in the detection folder", aviFiles.Length, jpgFiles.Length);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -19,6 +19,8 @@ public class CleanJob : IJob
|
||||
public async Task Execute(IJobExecutionContext context)
|
||||
{
|
||||
_logger.LogInformation("Cleaning up files...");
|
||||
_logger.LogInformation("RemoveOriginalFiles: {RemoveOriginalFiles}", _options.RemoveOriginalFiles);
|
||||
_logger.LogInformation("RemoveDetectionFiles: {RemoveDetectionFiles}", _options.RemoveDetectionFiles);
|
||||
if (_options.RemoveOriginalFiles)
|
||||
{
|
||||
CleanOriginalFiles();
|
||||
@ -40,7 +42,7 @@ public class CleanJob : IJob
|
||||
return;
|
||||
|
||||
//remove .mp4 files from the media folder
|
||||
_logger.LogDebug("Removing .mp4 files from media folder {MediaFolder}", _options.MediaFolder);
|
||||
_logger.LogInformation("Removing .mp4 files from media folder {MediaFolder}", _options.MediaFolder);
|
||||
foreach (var file in Directory.GetFiles(_options.MediaFolder!, "*.mp4"))
|
||||
{
|
||||
File.Delete(file);
|
||||
@ -55,7 +57,7 @@ public class CleanJob : IJob
|
||||
return;
|
||||
|
||||
//remove .avi files from the detection folder
|
||||
_logger.LogDebug("Removing .avi files from detection folder {DetectionFolder}", _options.Scanner.DetectionFolder);
|
||||
_logger.LogInformation("Removing .avi files from detection folder {DetectionFolder}", _options.Scanner.DetectionFolder);
|
||||
foreach (var file in Directory.GetFiles(_options.Scanner!.DetectionFolder!, "*.avi"))
|
||||
{
|
||||
File.Delete(file);
|
||||
|
@ -34,7 +34,7 @@ public class DownloaderJob : IJob
|
||||
return;
|
||||
}
|
||||
|
||||
//time to start retrieving videos
|
||||
//time to start retrieving videos,
|
||||
//for example, if options.From is 23:00 and options.FromDayBefore is true, from should be yesterday at 23:00
|
||||
var now = DateTime.Now;
|
||||
var minutes = _options.From.Split(":")[1];
|
||||
|
Loading…
Reference in New Issue
Block a user