attempt to clean up working directories

This commit is contained in:
Adam R Grey 2023-11-12 16:23:38 -05:00
parent 983a57b3d7
commit 54d2afac8d
2 changed files with 20 additions and 1 deletions

View File

@ -179,6 +179,25 @@ namespace ttrss_co_client
await ttrssClient.Logout();
Console.WriteLine($"logged out of ttrss.");
#region cleanup
Console.WriteLine("===== phase 3 =====");
//loop through working directory looking for other work orders to add
var subdirs = Directory.GetDirectories(conf.WorkingDirectory);
foreach(var subdir in subdirs)
{
if(Directory.GetFiles(subdir)?.Length == 0)
{
Console.WriteLine($"{subdir} is empty");
Directory.Delete(subdir);
}
else
{
Console.WriteLine($"{subdir} is not empty: {string.Join(", ", Directory.GetFiles(subdir))}");
}
}
#endregion
Console.WriteLine($"done for real");
}
static Configuration Configure(string configurationPath = "appsettings.json")

View File

@ -17,7 +17,7 @@ public class ChatMessage : Phase2Task
await Process.Start(ChatScript,
workOrder.data["chatmessage"] +
(await TtrssClient.GetArticles(workOrder.articleId)).First().feed_title +
"; " +
": " +
(await TtrssClient.GetArticles(workOrder.articleId)).First().title
).WaitForExitAsync();
return new Tuple<TaskStatus, WorkOrder>(TaskStatus.Done, workOrder);