Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip managing Cyberpunk Saves and avoid indexing 60GB of Archive/Pc/Content #2076

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ protected override IReadOnlyDictionary<LocationId, AbsolutePath> GetLocations(IF
var result = new Dictionary<LocationId, AbsolutePath>()
{
{ LocationId.Game, installation.Path },
{
LocationId.Saves,
fileSystem.GetKnownPath(KnownPath.HomeDirectory).Combine("Saved Games/CD Projekt Red/Cyberpunk 2077")
},
// Skip managing saves for now, to prevent accidental deletion of saves
// e.g. when removing loadouts, un-managing the game, or uninstalling the app
// {
// LocationId.Saves,
// fileSystem.GetKnownPath(KnownPath.HomeDirectory).Combine("Saved Games/CD Projekt Red/Cyberpunk 2077")
// },
{
LocationId.AppData,
fileSystem.GetKnownPath(KnownPath.LocalApplicationDataDirectory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ public class Cyberpunk2077Synchronizer : ALoadoutSynchronizer
/// </summary>
private static GamePath RedModTweaksFolder => new(LocationId.Game, "tools/redmod/tweaks");

private static GamePath ArchivePcContentFolder => new(LocationId.Game, "archive/pc/content");

private static GamePath ArchivePcEp1Folder => new(LocationId.Game, "archive/pc/ep1");


private readonly RedModDeployTool _redModTool;

Expand All @@ -41,16 +45,18 @@ protected internal Cyberpunk2077Synchronizer(IServiceProvider provider) : base(p

private static readonly GamePath[] IgnoredBackupFolders =
[
new GamePath(LocationId.Game, "archive/pc/content"),
new GamePath(LocationId.Game, "archive/pc/ep1"),
ArchivePcContentFolder,
ArchivePcEp1Folder,
];

public override bool IsIgnoredPath(GamePath path)
{
// Ignore the mod cache folder, as it's regenerated by redmod every time we deploy using the tool.

return path.InFolder(RedModCacheFolder)
|| path.InFolder(RedModScriptsFolder)
|| path.InFolder(RedModTweaksFolder);
|| path.InFolder(RedModScriptsFolder)
|| path.InFolder(RedModTweaksFolder)
|| !_settings.DoFullGameBackup && (path.InFolder(ArchivePcContentFolder) || path.InFolder(ArchivePcEp1Folder));
}

public override async Task<Loadout.ReadOnly> Synchronize(Loadout.ReadOnly loadout)
Expand Down
Loading