feat: complete clean job
This commit is contained in:
parent
85ac367e0c
commit
a0cc6ec55f
@ -34,11 +34,32 @@ public class CleanJob : IJob
|
|||||||
|
|
||||||
private void CleanOriginalFiles()
|
private void CleanOriginalFiles()
|
||||||
{
|
{
|
||||||
|
if (_options.MediaFolder is not null)
|
||||||
|
return;
|
||||||
|
if (_options.RunDry)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//remove .mp4 files from the media folder
|
||||||
|
_logger.LogDebug("Removing .mp4 files from media folder {MediaFolder}", _options.MediaFolder);
|
||||||
|
foreach (var file in Directory.GetFiles(_options.MediaFolder!, "*.mp4"))
|
||||||
|
{
|
||||||
|
File.Delete(file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CleanDetectionFiles()
|
private void CleanDetectionFiles()
|
||||||
{
|
{
|
||||||
|
if (_options.Scanner?.DetectionFolder is not null)
|
||||||
|
return;
|
||||||
|
if (_options.Scanner!.RunDry)
|
||||||
|
return;
|
||||||
|
|
||||||
|
//remove .avi files from the detection folder
|
||||||
|
_logger.LogDebug("Removing .avi files from detection folder {DetectionFolder}", _options.Scanner.DetectionFolder);
|
||||||
|
foreach (var file in Directory.GetFiles(_options.Scanner!.DetectionFolder!, "*.avi"))
|
||||||
|
{
|
||||||
|
File.Delete(file);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user