This commit is contained in:
Chenx221 2024-08-29 09:25:24 +08:00
parent cf900f831e
commit f3efacb784

View File

@ -87,6 +87,22 @@ namespace Comic_CBZ_Helper
// 设置初始日期
DateTime currentDate = new(2020, 1, 1, 0, 0, 0);
int count = 0;
int timeInc = 7;
// 寻找合适的日期增加量
DateTime tempDate = currentDate;
while (tempDate.AddHours(comicFolders.Count * timeInc) >= DateTime.Now)
{
timeInc--;
if (timeInc == 0)
{
Console.WriteLine("日期增加量无效,请修改代码");
return;
}
tempDate = currentDate;
}
// 循环处理每个漫画文件夹
foreach (var comicFolder in comicFolders)
{
@ -106,7 +122,7 @@ namespace Comic_CBZ_Helper
Console.WriteLine($"CBZ 文件 {cbzFileName} 已存在,跳过。");
count++;
processedFolders++;
currentDate = currentDate.AddHours(7);
currentDate = currentDate.AddHours(timeInc);
continue;
}
@ -167,7 +183,7 @@ namespace Comic_CBZ_Helper
Directory.Delete(tempFolder, true);
// 增加日期
currentDate = currentDate.AddHours(7);
currentDate = currentDate.AddHours(timeInc);
count++;
processedFolders++;