Skip to content

Commit

Permalink
Merge pull request #348 from /issues/345-RemoveNocacheFlag
Browse files Browse the repository at this point in the history
  • Loading branch information
tpill90 authored Jan 20, 2024
2 parents 6d27021 + d95526d commit 5d8db95
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
7 changes: 1 addition & 6 deletions SteamPrefill/CliCommands/PrefillCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public int? PrefillPopularGames
Converter = typeof(OperatingSystemConverter), Validators = new[] { typeof(OperatingSystemValidator) })]
public IReadOnlyList<OperatingSystem> OperatingSystems { get; init; } = new List<OperatingSystem> { OperatingSystem.Windows };

[CommandOption("nocache",
Description = "Skips using locally cached manifests. Saves disk space, at the expense of slower subsequent runs.",
Converter = typeof(NullableBoolConverter))]
public bool? NoLocalCache { get; init; }

[CommandOption("verbose", Description = "Produces more detailed log output. Will output logs for games are already up to date.", Converter = typeof(NullableBoolConverter))]
public bool? Verbose
{
Expand Down Expand Up @@ -66,7 +61,7 @@ public async ValueTask ExecuteAsync(IConsole console)
var downloadArgs = new DownloadArguments
{
Force = Force ?? default(bool),
NoCache = NoLocalCache ?? default(bool),
NoCache = AppConfig.NoLocalCache,
TransferSpeedUnit = TransferSpeedUnit,
OperatingSystems = OperatingSystems.ToList()
};
Expand Down
9 changes: 9 additions & 0 deletions SteamPrefill/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ private static List<string> ParseHiddenFlags()
args.Remove("--no-download");
}

// Skips using locally cached manifests. Saves disk space, at the expense of slower subsequent runs.
// Useful for debugging since the manifests will always be re-downloaded.
if (args.Any(e => e.Contains("--nocache")))
{
AnsiConsole.Console.LogMarkupLine($"Using {LightYellow("--nocache")} flag. Will always re-download manifests...");
AppConfig.SkipDownloads = true;
args.Remove("--nocache");
}

// Adding some formatting to logging to make it more readable + clear that these flags are enabled
if (AppConfig.EnableSteamKitDebugLogs || AppConfig.SkipDownloads)
{
Expand Down
5 changes: 5 additions & 0 deletions SteamPrefill/Settings/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,10 @@ public static bool EnableSteamKitDebugLogs
public static readonly string DebugOutputDir = Path.Combine(CacheDir, "Debugging");

#endregion

/// <summary>
/// Skips using locally cached manifests. Saves disk space, at the expense of slower subsequent runs. Intended for debugging.
/// </summary>
public static bool NoLocalCache { get; set; }
}
}
1 change: 0 additions & 1 deletion docs/mkdocs/detailed-command-usage/Benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Creates a benchmark "workload" comprised of multiple apps, that will then be ben
| --use-selected | Creates a workload file using apps previously specified with `select-apps`. Ideal for most use cases, since it likely aligns with games that will be downloaded by real event clients. |
| --all | Benchmark workload will be created using all currently owned apps. |
| --appid | The id of one or more apps to include in benchmark workload file. Useful for testing a specific app, without having to modify previously selected apps. AppIds can be found using [SteamDB](https://steamdb.info/) |
| --nocache | Skips using locally cached manifests. No recommended for use with `setup`, as it can dramatically increase the amount of time to build the workload file. |
| --no-ansi | Application output will be in plain text, rather than using the visually appealing colors and progress bars. Should only be used if terminal does not support Ansi Escape sequences, or when redirecting output to a file. |

-----
Expand Down
1 change: 0 additions & 1 deletion docs/mkdocs/detailed-command-usage/Prefill.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ It is possible to combine multiple flags together in a single command, rather th
| --recent | | | | Adds any games played within the last 2 weeks to the download queue. |
| --top | | 1-100 | **50** | Downloads the most popular games by player count, over the last 2 weeks. |
| --force | -f | | | By default, **{{prefillName}}** will keep track of the most recently prefilled apps, and will only attempt to prefill if there it determines there a newer version available for download. This default behavior will work best for most use cases, as no time will be wasted re-downloading files that have been previously prefilled. <br/><br/> Running with the flag `--force` will override this behavior, and instead will always run the prefill, re-downloading all files for the selected apps. This flag may be useful for diagnostics, or benchmarking network performance. |
| --nocache | | | | Skips using locally cached manifests. Normally **{{prefillName}}** will cache copies of manifests on disk, in order to dramatically speed up future runs. However, in some scenarios this disk cache can potentially take up a non-trivial amount of storage (300mb), which may not be ideal for all use cases. |
| --verbose | | | | Produces more detailed log output. By default, games that are already up to date will not be displayed at all. Specifying this option will make it so that all games, even ones up to date, will be logged. |
| --unit | | bits, bytes | **bits** | Specifies which unit to use to display download speed. |
| --no-ansi | | | | Application output will be in plain text, rather than using the visually appealing colors and progress bars. Should only be used if terminal does not support Ansi Escape sequences, or when redirecting output to a file. |

0 comments on commit 5d8db95

Please sign in to comment.