Skip to content

Command to delete grids that fail an IsWorking check for a specified block.#166

Closed
kontu wants to merge 2 commits intoTorchAPI:masterfrom
kontu:master
Closed

Command to delete grids that fail an IsWorking check for a specified block.#166
kontu wants to merge 2 commits intoTorchAPI:masterfrom
kontu:master

Conversation

@kontu
Copy link
Copy Markdown

@kontu kontu commented Aug 6, 2020

Commit 911b610 is just updating my fork to the current TorchAPI/Essentials master.

Commit 6aafed3 adds a "delete offtype" command to "!cleanup" to delete grids based on whether a specified blocktype is non-functional isWorking == false

Code originally written by Teknikal (AdamOckley), he just asked me to put in a clean pull request for it for him.

Copy link
Copy Markdown
Contributor

@LordTylus LordTylus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented an the file I would like that feature to be a condition instead of a separate command with duplicated deletion logic.

Unless Jim is fine with doing it that way.

Log.Info($"Cleanup deleted {count} grids matching conditions {string.Join(", ", Context.Args)}");
}

[Command("delete offtype", "Deletes grids with specified blocks toggled off.")]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a separate command tho?

I personally prefer it to keep it as !cleanup list or !cleanup delete

Instead you could have added a new condition you can see how for example HasType is implemented in line 385

As it is implemented now I have not the ability to just "list" which grids would be affected. And since I cannot see what would be affected I cannot check if my filter is correct or I for example need to exclude something with other conditions.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 years late but I agree with LordTylus

@Casimir255 Casimir255 closed this Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants