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

Allow an array or a value in automations regex field #399

Merged
merged 3 commits into from
Nov 24, 2024

Conversation

PabloOQ
Copy link
Collaborator

@PabloOQ PabloOQ commented Nov 22, 2024

Mentioned in #360 .

In the Automations, the regex field now allows use of both, arrays of Strings or a single String value.
Makes it easier to maintain a big file and more is accessible to add/remove regex to an individual rule.

@github-actions github-actions bot added the Core Change the core code (set automatically) label Nov 22, 2024
Copy link
Contributor

github-actions bot commented Nov 22, 2024

This PR builds correctly, here is the generated apk.
This unsigned version can be installed alongside the original app and should only be used for testing the changes, not for daily usage.

Download testing apk

You must be logged in for the link to work.
The link will expire in 14 days, at Sun Dec 8 16:21:12 UTC 2024.


This is an automatic comment created by a Github Action

@PabloOQ PabloOQ changed the title Regex array Allow an array or a value in automations regex field Nov 22, 2024
@github-actions github-actions bot added the Assets Changes some assets (set automatically) label Nov 24, 2024
@TrianguloY
Copy link
Owner

TrianguloY commented Nov 24, 2024

Personally I would have kept the getString method, because that will (according to the documentation) coerce the value (so, even if it's not a string, it will always return a string). This could be done also calling toString anyway.
But I like your generic approach to allow any type, not sure if there will be a need for something similar in the future, but looks good. Let's keep it for now.

I think I would have also created a new JsonUtils class, since these are not technically java utils, but that can be created later if more methods are added, so not a problem.

The only missing thing is to change the auto_editor string to explain this new option, but I just added it myself :)

(also, the code at com/trianguloy/urlchecker/modules/list/PatternModule.java:156 could be extracted to use this new method, although you will need to convert it to an opt...which I may do in the future, so don't worry about that for now)


Edit: Arg, I wanted to do a squash&merge, not a normal merge...anyway. I'm slow today :(

@TrianguloY TrianguloY enabled auto-merge November 24, 2024 16:19
@TrianguloY TrianguloY merged commit c891f85 into TrianguloY:master Nov 24, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Assets Changes some assets (set automatically) Core Change the core code (set automatically)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants