Skip to content

Commit

Permalink
Tweak CLI cache cleaner callback message and add some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Feb 7, 2024
1 parent 6d13c7f commit 765d800
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 5 additions & 3 deletions TwitchDownloaderCLI/Modes/DownloadVideo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ internal static void Download(VideoDownloadArgs inputOptions)
progress.ProgressChanged += ProgressHandler.Progress_ProgressChanged;

var downloadOptions = GetDownloadOptions(inputOptions);
downloadOptions.CacheCleanerCallback += directoryInfos =>
downloadOptions.CacheCleanerCallback = directoryInfos =>
{
// TODO: Poll for user input with a timeout for scripts
((IProgress<ProgressReport>)progress).Report(new ProgressReport(ReportType.Log, $"{directoryInfos.Length} unmanaged video caches were found in {downloadOptions.TempFolder} and can be safely deleted."));
Console.WriteLine(
$"[LOG] - {directoryInfos.Length} unmanaged video caches were found at '{downloadOptions.TempFolder}' and can be safely deleted. " +
"Run 'TwitchDownloaderCLI cache help' for more information.");

return Array.Empty<DirectoryInfo>();
};

Expand Down
4 changes: 4 additions & 0 deletions TwitchDownloaderCLI/Tools/CacheHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public static void ParseArgs(CacheArgs args)
{
PromptClearCache();
}

// TODO: Add option to print out cache information (i.e. individual sub-directory size, maybe in table form?)
// TODO: Add interactive cache delete mode (i.e. loop over each sub-directory with Yes/No delete prompts)
// TODO: Allow the user to specify a cache folder so it can be managed with the aforementioned tools
}

private static void PromptClearCache()
Expand Down

0 comments on commit 765d800

Please sign in to comment.