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");
|
var path = Path.Combine(_options.Scanner.DetectionFolder, name + ".avi");
|
||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
{
|
{
|
||||||
_logger.LogWarning("File {Path} does not exist", path);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
|
@ -68,6 +68,11 @@ public class DVRScanner : IDVRScanner
|
|||||||
await UpdateProcessUntilExits(process, cancellationToken);
|
await UpdateProcessUntilExits(process, cancellationToken);
|
||||||
_logger.LogInformation("Videos scanned successfully!");
|
_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)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -19,6 +19,8 @@ public class CleanJob : IJob
|
|||||||
public async Task Execute(IJobExecutionContext context)
|
public async Task Execute(IJobExecutionContext context)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Cleaning up files...");
|
_logger.LogInformation("Cleaning up files...");
|
||||||
|
_logger.LogInformation("RemoveOriginalFiles: {RemoveOriginalFiles}", _options.RemoveOriginalFiles);
|
||||||
|
_logger.LogInformation("RemoveDetectionFiles: {RemoveDetectionFiles}", _options.RemoveDetectionFiles);
|
||||||
if (_options.RemoveOriginalFiles)
|
if (_options.RemoveOriginalFiles)
|
||||||
{
|
{
|
||||||
CleanOriginalFiles();
|
CleanOriginalFiles();
|
||||||
@ -40,7 +42,7 @@ public class CleanJob : IJob
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//remove .mp4 files from the media folder
|
//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"))
|
foreach (var file in Directory.GetFiles(_options.MediaFolder!, "*.mp4"))
|
||||||
{
|
{
|
||||||
File.Delete(file);
|
File.Delete(file);
|
||||||
@ -55,7 +57,7 @@ public class CleanJob : IJob
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//remove .avi files from the detection folder
|
//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"))
|
foreach (var file in Directory.GetFiles(_options.Scanner!.DetectionFolder!, "*.avi"))
|
||||||
{
|
{
|
||||||
File.Delete(file);
|
File.Delete(file);
|
||||||
|
@ -34,7 +34,7 @@ public class DownloaderJob : IJob
|
|||||||
return;
|
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
|
//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 now = DateTime.Now;
|
||||||
var minutes = _options.From.Split(":")[1];
|
var minutes = _options.From.Split(":")[1];
|
||||||
|
Loading…
Reference in New Issue
Block a user