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

[DISCUSSION] Automatically remove duplicates via icontool.py #1269

Open
x9136 opened this issue May 27, 2023 · 11 comments
Open

[DISCUSSION] Automatically remove duplicates via icontool.py #1269

x9136 opened this issue May 27, 2023 · 11 comments

Comments

@x9136
Copy link
Collaborator

x9136 commented May 27, 2023

About this discussion

Duplicates.mp4

Many components in the appfilter.xml have duplicates, so I suggest finding a way to automatically remove them.

I think icontool.py now checks for alphabetical sorting at runtime and fixes it. This will work with duplicates as well. If the lines are identical, leave one. If the components are identical but have different names or svg, somehow inform about it (not sure if the current check in icontool.py works that way).

It will be cleaner.

@SuperDragonXD
Copy link
Contributor

Just so you know, there's a tool called find_duplicates.py to help with this.

They could probably be merged in a new PR, although I currently don't have the time to do this.

@x9136
Copy link
Collaborator Author

x9136 commented Aug 17, 2023

@SuperDragonXD The number of duplicates is growing again because many people are manually adding components. Is there any reason why we can't do automatic duplicate removal? The same way automatic sorting happens.

Maybe this should be done automatically before creating a release build. I'm not sure which moment is the best, but clearly that can be given to the computer.

@KTibow
Copy link
Contributor

KTibow commented Aug 17, 2023

damn you keep editing your comment

it's not possible for GH Actions to push anymore because they enabled push protection, so it can't be fully automatic
i agree it should be done manually before the next release though
and it's always an option to make the workflow fail if there are unused/duplicate/out-of-order icons

@x9136
Copy link
Collaborator Author

x9136 commented Aug 17, 2023

@KTibow You can already delete duplicates manually with a single command. I think it is logical to automate it. One option is the same as with automatic sorting. You run any command, and icontool.py cleans duplicates along with it.

@KTibow
Copy link
Contributor

KTibow commented Aug 17, 2023

You can already delete duplicates manually with a single command. I think it is logical to automate it

well - it's not possible to automate it with github actions (because push protection - unless you do some sort of workaround)
to clarify: when i said "it's always an option to make the workflow fail" i meant that it would say "go run icontool on your own device", because even though the action can sort it, it can't push (because push protection)

@x9136
Copy link
Collaborator Author

x9136 commented Aug 17, 2023

@KTibow Ok, I understand about GitHub Actions. I'm talking about using icontool.py.

@KTibow
Copy link
Contributor

KTibow commented Aug 17, 2023

okay - so what do you mean by automatically then? do you mean that "icontool should be ran to clean up the app filter/icons before the next release"?

@x9136
Copy link
Collaborator Author

x9136 commented Aug 17, 2023

@KTibow

python3 icontool.py add /Users/otttis/Desktop/export/fraction_calculator_plus com.digitalchemy.calculator.freefraction/com.digitalchemy.calculator.droidphone.FractionMainActivity "Fraction Calculator Plus"

When I run a command like this, icontool.py not only adds the component, but also sorts the entire list. I think it would be possible to remove duplicates at the same time. For example, before sorting. In this case, manual cleanup of duplicates before release may not be necessary.

@KTibow
Copy link
Contributor

KTibow commented Aug 17, 2023

so you think it should run maintenance every time an icon is added?
i doubt most users will be using icontool so running icontool before release will probably still be necessary. plus running maintenance can create merge conflicts.

@KTibow
Copy link
Contributor

KTibow commented Aug 17, 2023

also its kinda ironic youre saying this given you introduced duplicates in #1358 (but also kinda makes sense)

@x9136
Copy link
Collaborator Author

x9136 commented Aug 17, 2023

@KTibow On the one hand I was using only icontool.py, and on the other hand I was fixing conflicts and making merges with what the previously accepted PRs gave. In all this fuss, duplicates could appear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants