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

Set default settings on install/update #30

Open
Valkyr-JS opened this issue Jun 20, 2024 · 2 comments
Open

Set default settings on install/update #30

Valkyr-JS opened this issue Jun 20, 2024 · 2 comments
Labels
blocked Issue depends on another issue being fixed first bug Something isn't working

Comments

@Valkyr-JS
Copy link
Owner

Stash treats plugin settings as undefined until the user manually changes them, however their default appears as 0 numbers and false for booleans. This is problematic for users updating these values in the first instance, when a default should have a higher number or true as the default. For example, Most Appears With should show a default of 3, not 0.

This can potentially be set with a subscription to check when the plugin is installed or updated, and when triggered run a mutation on the plugin settings. This may not work, however.

@Valkyr-JS Valkyr-JS added the bug Something isn't working label Jun 20, 2024
@Valkyr-JS Valkyr-JS changed the title Set default value on install/update Set default settings on install/update Jun 20, 2024
@Valkyr-JS Valkyr-JS added the blocked Issue depends on another issue being fixed first label Jun 20, 2024
@Valkyr-JS
Copy link
Owner Author

This seems possible on updating packages, but not on installing packages, which is the ideal time for it to run. The GQL seems to need to run within a PluginApi.patch.... So this can't run immediately on install.

Even if this was possible, it would be a pretty hacky way to do it. The ideal way would be to have a native defaultSettings property in the plugin yaml file, like defaultArgs for tasks. Will raise as a request and revisit this issue if/when that is implemented.

@Valkyr-JS
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Issue depends on another issue being fixed first bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant