WIP Cleanup Tool
#1
Question 
I am currently writing a program code to delete useless stuff in order to save memory on my device.
so far i have been able to do the following:
- clear cache folder
- delete the "kodi.old.log" file
- delete the thumbnail folder (full folder)
- delete the files within Database folder (not able to delete Addons19.db & Texture13.db)
- delete the packages folder within addons folder

what i need help with
is there a possibility to delete those 2 db files?
Code:
def deleteThumbnails():
    if os.path.exists(thumbnailPath)==True:
        try: shutil.rmtree(thumbnailPath)
        except: pass

also, i have wizard that i use to load the onto android box
what i want to is within the wizard i want to be able to delete the previous folder and then install my backup
I have the code that does what i want but i have to hard code the folders that i want to save within the addons folder in default.py
i want to be able to enter the folders name in text file and read the text file in the default.py and work from there.
Code:
def deleteAddons():
    saveFolders = ["<FOLDER NAME I NEED TO SAVE>"
    #saveFolders = []
    #text_file_path = os.path.join(myAddonPath, "SaveAddonFolders.txt")
    #with open(text_file_path, "r") as reader:
    #    saveFolders = list(reader)
        #open_file.close()

    if os.path.exists(addonPath)==True:
        for d in os.listdir(addonPath):
            if d not in saveFolders:
                try: os.remove(os.path.join(addonPath,d))
                except: shutil.rmtree(os.path.join(addonPath,d))
                dialog = xbmcgui.Dialog()
                #dialog.ok("Maintenance Tool", "Done deleting extra addons")
                dialog.ok("Maintenance Tool", d)
part that is commented out is what i am trying but its not working
myAddonPath = kodi\addons\plugin.program.cleanup_tool\

any help would be much appreciated
once done i would be releasing the addon for the community
Reply
#2
Quote:writing a program code to delete useless stuff in order to save memory

humm.. some of that stuff is not exactly useless to Kodi. From the looks, I would say a drive format would make it all spotless. Cache is always around, that's what help Kodi be as quick as it is when flowing through your contents. The log file is created each load, and the old one is named old, so it's like a conveyor belt file system, constantly replacing each other (why delete, it just comes back in two launches), The add-on packages are kept so that you can revert backwards, should the latest not be the greatest, There's a clean-up routine that will clean those packages out on heavy accumulation. "delete the thumbnail folder (full folder)" what? You delete the thumbnails and you'll lose all the graphics in operation, Gads " files within Database folder (not able to delete Addons19.db, saltscache.db & Texture13.db)" you're planning on killing the library too....?

" i have wizard that i use" Now you have me worried.
Reply
#3
I have 3 droid box in 3 different geo location
what i want to do is within the skin of my choice create a button called UPDATA which is linked to my wizard
i want to be able delete those folders because they will be replaced with my wizard.
Reply
#4
Good luck on that..

http://lifehacker.com/5634515/how-to-syn...-the-house
http://wiki.xbmc.org/index.php?title=HOW..._libraries
http://www.howtogeek.com/75535/how-to-sy...with-xbmc/
http://forum.xbmc.org/showthread.php?t=86430
http://forum.xbmc.org/showthread.php?p=7...post733974
Reply
#5
saltscache.db sounds more like something associated with a banned add-on (wiki) , and not part of Kodi at all.

I would also echo Pat's comments above - you need to think about this more as some of the stuff you suggest is most definitely not stuff you should mess with our delete randomly.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#6
what i am aiming for is do a cleanup and then install the wizard

@PatK thanks for the links but those links are if i have a server that hosts video/ music and using kodi to sync to that (correct me if i am wrong)
but, thats not what i am looking for (as i am not hosting any server). I have created a wizard of my setup and i am pushing that same setup onto other devices.
Reply
#7
Would you please read the bloody forum rules (wiki) and banned add-ons (wiki) list!

Fresh start, and indeed most other "wizards" are banned here, as is discussion about them. That particular one comes from a banned repo and the author is a well known source of piracy crap. Also read the Official:Trademark Policy (wiki) concerning distribution of add-ons with Kodi. A clean-up tool is one thing, but redistribution is something else entirely and generally not allowed.

Bottom line is that any such "maintenance tools" usually are frowned upon here as they tend to do more harm than good and risk utterly screwing things up (or worse) if things go wrong.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#8
okay i understand and read the rules (therefore, removed the ref to banned add-ons)
i am not distributing such stuff with Kodi (these are for myself /my family personal use ONLY)

having said that i want to be able to conserve the memory of my droid box which is only about 1.5 gb (or less)
what are my options then? i found the the advance setting to reduce the package folder size
Reply
#9
Why are you team members taking a dump all over bajwamar instead of helping him? I found this thread because after a couple of years Kodi is taking up about 2gb of space on my ssd and needs cleaning. The only maintenance tool addons are all from pirates. The official Kodi solution seems to lead down a rabbit hole of coding involving python and github and command interfaces. So thank you, bajwamar, for attempting to address this problem.
Reply
#10
Because most of those maintenance tools often end up doing more harm than good.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#11
I found a solution here: http://www.htpcbeginner.com/clear-kodi-t...ils-cache/

Deleting the thumbnail folder and letting Kodi repopulate it took the folder size from 2.03 gb down to only 69mb!
Reply
#12
@Pisomojado
good that you found the solution where you manually edit the directory (its easy on PC) but, when using this on a Box its not so simple
it took a lot of back and forth but I was able write the code to delete the files and works perfectly for my purpose
Reply

Logout Mark Read Team Forum Stats Members Help
Cleanup Tool0