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

Inital release of Telegram Desktop cleaner #270

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions pending/telegram_desktop.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

BleachBit
Copyright (C) 2008-2019 Andrew Ziem
https://www.bleachbit.org

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

@app Telegram Desktop
@url https://desktop.telegram.org/
@os Windows, Linux, macOS
@cleanerversion v1.0.0
@cleanerdate 2019-11-14
@cleanerby Tobias B. Besemer
@tested ok v???, Windows ???
@testeddate ???
@testedby ???
@note Linux $$ProgramFiles$$ not yet figured out! I will do this later! Tobias.

-->
<cleaner id="telegram_desktop">
<label>Telegram Desktop</label>
<description>Messaging program</description>
<!-- Not yet figured out:
<running type="exe" os="linux">telegram</running>
-->
<running type="exe" os="windows">Telegram</running>
<option id="log">
<label>Log</label>
<description>Delete the log</description>
<!-- Linux: -->
<!-- Not yet figured out! -->
<!-- Windows: -->
<action command="delete" search="file" path="%AppData%\Telegram Desktop\log.txt"/>
<!-- macOS: -->
<!-- Not yet figured out! -->
</option>
<option id="memory_dumps">
<label>Memory Dumps</label>
<description>Delete the files</description>
<!-- Linux: -->
<!-- Not yet figured out! -->
<!-- Windows: -->
<action command="delete" search="walk.all" path="%AppData%\Telegram Desktop\tdata\dumps"/>
<!-- macOS: -->
<!-- Not yet figured out! -->
</option>
<option id="cache">
<label>Cache files</label>
<description>Delete the cache files</description>
<!-- Linux: -->
<!-- Not yet figured out! -->
<!-- Windows: -->
<action command="delete" search="walk.all" path="%AppData%\Telegram Desktop\tdata\user_data\cache"/>
<action command="delete" search="glob" path="%AppData%\Telegram Desktop\tdata\user_data\cache\*"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This glob line looks redundant to the walk.all above it

Copy link
Contributor Author

@Tobias-B-Besemer Tobias-B-Besemer Nov 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hadn't we noted in the docs, that if I want to delete the content of a folder including all sub-folders, I have to use ATM "walk.all" followed by "glob"? Read that so in the doc, again...
This was AFAIK also the reason you introduced "walk.top" in BB3.0...
I noted in the doc to it:

Starting with BleachBit v3.0 there is command="delete" search="walk.top" as a single command to do that!
But as some users still stay on Windows XP with BleachBit v2.2 (last version for WinXP) but use new cleaners, it is highly recommended to use this new feature at the moment with care!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To accomplish this goal, change glob to file and change cache\* to just cache. As it is, I think it won't delete the cache directory itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK, my solution deletes all in the "cache" folder and your solution would delete the "cache" folder itself...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I searched in "stable" for an example, but can't find one... The only example I found now (first hit) is this one: https://github.com/az0/cleanerml/blob/master/pending/windows_recycle_bins_more.xml

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to delete the top directory, I would use walk.top.

Yes, feel free to take a break! You work faster than I do :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the compliment! :-) But the harder Python part still remains to you... ;-)

Yeah, seems that's the prob! I just want to delete the complete content incl. the sub-folders of the folder!
And I think I can remember that we had a other solution to accomplish this goal, too, but with the solution I documented and used now, the cleaning of the files is better displayed and/or calculated in BB because BB deletes them all step by step and displays and calculates it! ;-)

I make now a test run with the cleaner and makes some screenshot of the folder & content & BB output during this for you. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here some SS...

The folder "cache" have just one sub-folder in my case...

2019-11-14 07_24_49-C__Users_Administrator_AppData_Roaming_Telegram Desktop_tdata_user_data_cache

...but in this sub-folder there are 257 (!!!) more sub-folders that include the >15.500 files !!!

2019-11-14 07_25_08-C__Users_Administrator_AppData_Roaming_Telegram Desktop_tdata_user_data_cache_0

First a test of deleting the log file...

2019-11-14 08_18_09-BleachBit

...then a test of deleting the "Memory Dumps"...

2019-11-14 08_21_11-BleachBit

...and then the cleaning of the cache folders...
...but as you can see: It run into an Error 1 !!!

2019-11-14 08_35_01-BleachBit

Here is a SS from the debugging window:

2019-11-14 08_36_34-Administrator_ C__Windows_system32_cmd exe - bleachbit_console exe  --gui --debu

But the cache folder is empty as intended !!!

2019-11-14 08_38_25-C__Users_Administrator_AppData_Roaming_Telegram Desktop_tdata_user_data_cache

...so I have no clue what the "Error 1" should mean!

Note: There are maybe some space for improvements of the cleaner regarding the strings used...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't understand

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, which part?

The cleaner works like intended, but I get a error 1.

<action command="delete" search="walk.all" path="%AppData%\Telegram Desktop\tdata\user_data\media_cache"/>
<action command="delete" search="glob" path="%AppData%\Telegram Desktop\tdata\user_data\media_cache\*"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This glob line looks redundant to the walk.all above it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at my comment above, plz.

<!-- macOS: -->
<!-- Not yet figured out! -->
</option>
</cleaner>