-
-
Notifications
You must be signed in to change notification settings - Fork 367
Allows enabling/disabling installed extensions #1275
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
base: master
Are you sure you want to change the base?
Allows enabling/disabling installed extensions #1275
Conversation
|
I think you overcomplicated this -- you can already disable extensions by putting EDIT: on discord fair counter to this was given |
| } | ||
|
|
||
| /// <summary>Returns normalized "src/Extensions/{folderName}/" for a direct child folder match, or null if not found.</summary> | ||
| public static string GetNormalizedExtensionFolderPath(string folderName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function does nothing
| } | ||
|
|
||
| /// <summary>Builds <see cref="DisabledExtensions"/> and returns disabled extension folders.</summary> | ||
| public HashSet<string> BuildDisabledExtensionsAndGetDisabledFolders() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is slowly manually rebuilding a list that's already saved? And is redundant
| { | ||
| return false; | ||
| } | ||
| int removed = Program.ServerSettings.Extensions.DisabledExtensions.RemoveAll(f => string.Equals(f, folderName, StringComparison.OrdinalIgnoreCase)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these string.equals ordinal things still do not need to exist as commented before
| /// <summary>Removes an extension folder from the disabled list in settings.</summary> | ||
| public bool RemoveDisabledExtensionSetting(string folderName) | ||
| { | ||
| folderName = folderName?.Trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these cleanups and checks aren't needed
| public HashSet<string> InstalledExtensionFolders = []; | ||
|
|
||
| /// <summary>Folder names of disabled extensions.</summary> | ||
| public HashSet<string> DisabledExtensions = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is a duplicate tracker of what's already in settings
| <th>Actions</th> | ||
| </tr> | ||
| @foreach (ExtensionsManager.ExtensionInfo ext in Program.Extensions.KnownExtensions.Where(e => !Program.Extensions.LoadedExtensionFolders.Contains(e.FolderName) && !e.Tags.Contains("hidden"))) | ||
| @foreach (ExtensionsManager.ExtensionInfo ext in Program.Extensions.KnownExtensions.Where(e => !Program.Extensions.InstalledExtensionFolders.Contains(e.FolderName) && !e.Tags.Contains("hidden"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put this back
| public HashSet<string> LoadedExtensionFolders = []; | ||
|
|
||
| /// <summary>Hashset of folder names of all extensions currently installed (loaded or disabled).</summary> | ||
| public HashSet<string> InstalledExtensionFolders = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a redundant duplicate of already tracked data
I can keep the button in its current slot, or move it somewhere else.
All enabled:
Pending restart after disable:
One disabled: