Compare commits
No commits in common. "513a9d6d45a8a8206a91fc225b68720dff6b8d98" and "ba1021c5e678bef1890d1412feec0223cd4c30de" have entirely different histories.
513a9d6d45
...
ba1021c5e6
@ -79,7 +79,6 @@ public class AutoScanApp
|
|||||||
|
|
||||||
await _scheduler.ScheduleJob(downloaderJob, trigger, cancellationToken);
|
await _scheduler.ScheduleJob(downloaderJob, trigger, cancellationToken);
|
||||||
await _scheduler.AddJob(scannerJob, false, true, cancellationToken);
|
await _scheduler.AddJob(scannerJob, false, true, cancellationToken);
|
||||||
await _scheduler.AddJob(cleanJob, false, true, cancellationToken);
|
|
||||||
|
|
||||||
_logger.LogDebug("Scheduled job successfully!");
|
_logger.LogDebug("Scheduled job successfully!");
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,6 @@ public class DVRScanner : IDVRScanner
|
|||||||
_logger.LogInformation("Dry run enabled, skipping execution...");
|
_logger.LogInformation("Dry run enabled, skipping execution...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CleanDetectionFiles();
|
|
||||||
_startedAt = DateTime.Now;
|
_startedAt = DateTime.Now;
|
||||||
process.Start();
|
process.Start();
|
||||||
// process.PriorityClass = ProcessPriorityClass.High;
|
// process.PriorityClass = ProcessPriorityClass.High;
|
||||||
@ -68,6 +66,7 @@ public class DVRScanner : IDVRScanner
|
|||||||
await UpdateProcessUntilExits(process, cancellationToken);
|
await UpdateProcessUntilExits(process, cancellationToken);
|
||||||
_logger.LogInformation("Videos scanned successfully!");
|
_logger.LogInformation("Videos scanned successfully!");
|
||||||
|
|
||||||
|
RemoveVideoFiles();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@ -88,19 +87,16 @@ public class DVRScanner : IDVRScanner
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CleanDetectionFiles()
|
private void RemoveVideoFiles()
|
||||||
{
|
{
|
||||||
if (_options.Scanner?.DetectionFolder is null)
|
|
||||||
return;
|
|
||||||
if (_options.Scanner!.RunDry)
|
|
||||||
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);
|
if (_options.Scanner?.DetectionFolder is not null && !_options.Scanner.RunDry)
|
||||||
foreach (var file in Directory.GetFiles(_options.Scanner!.DetectionFolder!, "*"))
|
|
||||||
{
|
{
|
||||||
File.Delete(file);
|
_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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -34,32 +34,11 @@ 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