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

SystemCleaner "base path" behavior #2243

Open
Edfgdz opened this Issue Jan 2, 2019 · 11 comments

Comments

2 participants
@Edfgdz
Copy link

Edfgdz commented Jan 2, 2019

System Cleaner has some problem that may cause wrong deletion.

When i added one folder [/storage/emulated/0/.c] into basepath, systemcleaner will scan out [/storage/emulated/0/.cc], [/storage/emulated/0/.clipboard] and [/storage/emulated/0/.ccf5d48d821324d1a992687444a73464].

I think if someday i want to delete one folder [/storage/emulated/0/.c], sd maid can delete more folder/files that i don't want it delete.

So could you fix this problem?

@d4rken

This comment has been minimized.

Copy link
Owner

d4rken commented Jan 2, 2019

This is by design.

"Basepath" could be more accurately named "Path starts with".

You have to either append a / at the end, e.g. /storage/emulated/0/.c/

Or you add .c to "name starts with" and "name ends with", which then would act like a fictive "name equals".

@d4rken d4rken closed this Jan 2, 2019

@Edfgdz

This comment has been minimized.

Copy link

Edfgdz commented Jan 2, 2019

I think this design is too complex.

Add a complete file/folder path into basepath and system cleaner search out that file/folder with that name without other folder/file is more easily to be understanded by user.

@d4rken

This comment has been minimized.

Copy link
Owner

d4rken commented Jan 2, 2019

If you create the filter from the Explorer, it will automatically add /storage/emulated/0/.c/.

I don't think adding a / at the end is too complex. "Basepath" seems to be missleading though, we could rename it to "Path starts with" to make the behavior more obvious.

@d4rken d4rken added the enhancement label Jan 2, 2019

@d4rken d4rken added this to the Next Tasks milestone Jan 2, 2019

@d4rken d4rken added the help wanted label Jan 2, 2019

@d4rken d4rken reopened this Jan 2, 2019

@d4rken

This comment has been minimized.

Copy link
Owner

d4rken commented Jan 2, 2019

If we restrict the matching of this field to only "whole folders", then it would make the filters less powerful and also break everyone filters who use this mechanic to match multiple paths.

@Edfgdz

This comment has been minimized.

Copy link

Edfgdz commented Jan 2, 2019

I know that add / can delete content in folder and keep that folder.
However i always want to delete whole folder and don't keep that folder.

I think this is more simple and straightforward.

You can add a setting that user can choose open/close this mechanic themeselves in sd maid. settings to care about those users.

@d4rken

This comment has been minimized.

Copy link
Owner

d4rken commented Jan 2, 2019

You can add a setting that user can choose open/close this mechanic themeselves in sd maid. settings to care about those users.

Changing the filtering engine to require options is not a very clean approach. I would prefer to not modify the way filters work. It would be cleaner to rename "basepath" to "starts with" and add a new "basepath", but any new filter criterium costs scan speed.

We could change the explorer tool to have an option "whole folder" vs "content" and then it would automatically created the right filter as mentioned in #2243 (comment) this would make it less complex to create a filter.

@Edfgdz

This comment has been minimized.

Copy link

Edfgdz commented Jan 2, 2019

At present this design could make user has more workloads.

Because if one user want to delete whole folder,he must add folder path into basepath and add folder name into name end with, if he doesn't do that, there always be possibility that sd maid could delete more folders which he doesn't want to delete,because user can't remember all folder/file names,sd maid could scan out some folder/file that he doesn't know to delete.

If basepaths too much,it will be a pain for him to do this work.

@Edfgdz

This comment has been minimized.

Copy link

Edfgdz commented Jan 2, 2019

You want to add another basepath, does this basepath has mechanic restriction?

I add that folder not from Explorer, i firstly copy that folder path and add it to filter manually.

@d4rken d4rken changed the title Another problem with system cleaner SystemCleaner "base path" behavior Jan 2, 2019

@Edfgdz

This comment has been minimized.

Copy link

Edfgdz commented Jan 2, 2019

I have two ideas to reduce scan time,not sure if it will work.

Userfilter are composed of several factors,some factors have been added by user,some haven't.

If one factor hasn't been added.by user,is it possible that make sd maid believe this factor are not been coded into filter,and sd maid can scan this filter without using corresponding code of factor hasn't been added,in another word,make sd maid skip that code.

Not sure if you can change sd maid scanning code structure to make it happen.

Another idea is that you can make sd maid put added factors into one group,put unadded factors into another group backgroundly when user add paths.

When sd maid scan paths,it can scan added factors group and not scan unadded group.

I think second idea could spend more time.

@d4rken

This comment has been minimized.

Copy link
Owner

d4rken commented Jan 2, 2019

SD Maid already does that.

I think the most sensible to actually add a new filter type and rename the existing one.
Then change the explorer action to correctly use the new type that only does exact matches on items.

@d4rken d4rken added the c: Explorer label Jan 2, 2019

@Edfgdz

This comment has been minimized.

Copy link

Edfgdz commented Jan 3, 2019

OK.But after i upgrade to that version,can you make file paths in basepath migrate to new filter type from the basepath at present?

I don't want to migrate them manually at that time,because of lots of work.

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