i had my math right the first time
or close idk
This commit is contained in:
parent
799eac006a
commit
ba924775f2
@ -42,11 +42,14 @@
|
|||||||
if(feed.KeepCount != null && feed.KeepCount > 0)
|
if(feed.KeepCount != null && feed.KeepCount > 0)
|
||||||
{
|
{
|
||||||
var files = Directory.GetFiles(feed.OutputDir, "*" + ext);
|
var files = Directory.GetFiles(feed.OutputDir, "*" + ext);
|
||||||
if(files.Length > feed.KeepCount -1)
|
//Console.WriteLine($"in {feed.OutputDir}, I see {files.Count()} files with extension {ext}");
|
||||||
|
if(files.Length > feed.KeepCount - 1)
|
||||||
{
|
{
|
||||||
files = files.Order().Take((int)feed.KeepCount -1).ToArray();
|
files = files.Order().Take(files.Length - (int)feed.KeepCount + 1).ToArray();
|
||||||
|
//Console.WriteLine($"filtered down to {files.Length}");
|
||||||
foreach(var f in files)
|
foreach(var f in files)
|
||||||
{
|
{
|
||||||
|
Console.WriteLine($"deleting {f}");
|
||||||
File.Delete(f);
|
File.Delete(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user