Release Profile Cleaner
#1
Current version: 1.0.4

What is it?
Profile Cleaner is a program addon aimed at cleaning a user's profile from useless files, be them textures, images o uninstalled addons. It is based on the wonderful Thumbnails Cleaner (http://forum.kodi.tv/showthread.php?tid=158972) by m4x1m

Features
  • Main features of Thumbnails Cleaner by m4x1m (texture cleanup, search and delete, empty texture db)
  • Delete addon settings for uninstalled addons
  • Delete addon packages for uninstalled addons
  • Limit number of addon packages to keep
  • Ability to simulate deletion, move files to a backup directory or directly delete files
  • Recognition of texture folder redirection as configured in advancedsettings.xml

How does it work?
The approach is the same as Thumbnails Cleaner: the program looks for actual, used content in Kodi and deletes/moves/copies whatever else remains.
The "limit number of addon packages to keep" works by listing all packages of a single addon and removes all the oldest versions, leaving the required number of versions for rollback. This option is useful to those who don't want to limit the size of the addon rollback folder, yet limit the number of rollback packages available.

Download
Github repo: https://github.com/cibboy/script.profilecleaner

Kodi support
This addon supports Kodi 13+ (so Gotham and up), and has been tested more thoroughly on Kodi 16 (Jarvis)

Acknowledgements
Special thanks to Max (m4x1m) Headroom for writing the original Thumbnails Cleaner upon which this addon is based.
Reply
#2
thank you! had a problem with thumbs and this cleaner fixed the problem. also the kodi folder reduced from 2,6 gb to 0,5 gb. all is working fine now, no problems anymore.
Reply
#3
On Android (6.1) with Jarvis I get the following error when launching the addon:

Code:
15:28:40 T:18446744072179390768  
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.AttributeError'>
Error Contents: _ElementInterface instance has no attribute 'iter'
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.profilecleaner-master/script.py", line 5, in <module>
from common import *
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.profilecleaner-master/common.py", line 27, in <module>
for node in root.iter('substitute'):
AttributeError: _ElementInterface instance has no attribute 'iter'
-->End of Python script error report<--

my advancedsettings.xml uses path substitution for the thumbnails:

Code:
<from>special://thumbnails</from>
<to>/storage/7E22-7086/Android/data/org.xbmc.kodi/files/thumbnails</to>
Reply
#4
That's a problem that was already notified on my changes to Thumbnails Cleaner but I forgot to merge the fix into this one.
Version 1.0.2 should fix it. Please download the new package from Github and try again. Smile
Reply
#5
It works now - thank you

I did receive the following error but it was easily fixed by creating the Thumbnails folder in userdata: (I can confirm it follows the path substitution by using the search function in the addon)

Code:
11:01:59 T:18446744072397990192   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.OSError'>
                                            Error Contents: (2, 'No such file or directory', '/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/Thumbnails/')
                                            Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.profilecleaner-master/script.py", line 986, in <module>
                                                Cleaner().PerformCleanup(9)
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.profilecleaner-master/script.py", line 957, in PerformCleanup
                                                self.ThumbnailCleanup()
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.profilecleaner-master/script.py", line 86, in ThumbnailCleanup
                                                self.ExploreThumbnailsFolder(thumbnailsFolder)
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.profilecleaner-master/script.py", line 16, in ExploreThumbnailsFolder
                                                for item in os.listdir(thumbnailsFolder):
                                            OSError: (2, 'No such file or directory', '/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/Thumbnails/')
                                            -->End of Python script error report<--
Reply
#6
Thumbs Up 
Great, will definitely give it a try! (I'm currently using the one by Max1m but I don't think it cleans up unused addon data).

What puzzles me is why isn't this a core feature of Kodi itself? i.e. garbage collecting every month or so?

PS edit: what Kodi version is supported? Isengard and Jarvis?
Reply
#7
I'm using it on Jarvis.
Reply
#8
It should work on Frodo and up, but it's been actually tested only on Jarvis. The thumbnail cleanup part has been tested on Isengard, Jarvis and Krypton.
Reply
#9
Found you today and testing seems to work great. Installing zip on Android Arm7 Helix gave dependencies not met but I just extracted the folder from zip and manually pasted into addons path and it works great. Currently testing on Jarvis arm7 android now.
Reply
#10
There are only 2 dependencies in this addon: script.module.simplejson and xbmc.python. Since apparently it works by manually copying the folder, I guess that xmbc.python 2.20.0 is too strict a requirement. Just for future reference, could you please check whether you version of script.module.simplejson is 3.3.0?
Thank you Smile
Reply
#11
zeppy,

I ran the script a couple of hours apart and it continues to find stuff to clean and delete.

Not sure why I didn't clean everything the first time I ran the script

Thanks
Reply
#12
Zeppy

yes it is mate

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.module.simplejson"
name="simplejson"
version="3.3.0"
provider-name="Martijn">
Reply
#13
Thanks for the heads up, I've relaxed requirements on xbmc.python in version 1.0.3 so it should install from zip even on Gotham and Helix.
Reply
#14
Great addon,a must have!
thanks.
Reply
#15
Brilliant, one of the best addon a around.

Must have for folk on systems that are low on internal memory.
(Fire stick in my case)


Only change I would request is having the main menu enabled by default. Or have the settings appear on first run.
Reply

Logout Mark Read Team Forum Stats Members Help
Profile Cleaner2