• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 28
Release Janitor
#1
Image
Click here to buy me a coffee

Official Release: 5.0.1- Available through the Kodi official addon repository.

*** Please enable debugging in Janitor's settings, upload your kodi.log and post a link, or make use of the Kodi Logfile Uploader addon. This is the best way to troubleshoot any issues you might have. ***

What does this addon do?
Janitor helps you keep a clean Kodi video library by deleting any video that you have watched in the past. The videos can be either deleted permanently or moved to a holding folder (the default setting). You may also enable some of the various filters to apply before videos are deleted, for example "do not delete videos that have a rating lower than 8" or "wait to delete videos until my free disk space is less than 20%". Janitor can run as a service or started manually. When you enable service mode you may set a scan interval, as well as specify a startup delay. You can also choose to hold off on cleaning while you're watching a video. In that case cleaning will wait until the next interval has passed before trying again.

Note: Please confirm you have set everything up correctly before switching to the permanent deletion option. If you're not sure what videos will be deleted, please set up a holding folder and check what has been moved there. Once you feel everything is working fine, you can choose to turn on permanent deletion.

Installation
  1. In Kodi, go to Settings » Add-ons » Install from repository » Program add-ons
  2. Select Janitor and choose install
After installation you are encouraged to take a good look at all the options that are available to you.

Note
Janitor is marked broken in Kodi 16 (Jarvis) and earlier. This was the final step in moving over from the old name "XBMC File Cleaner" to "Janitor." Since the internal workings still relied upon the old name and the addon has long since been renamed to Janitor, I felt it was time to cut ties with the past. This does not mean the Jarvis version does not work anymore though. You can still install it, but you will have to do so by installing the last working version (4.2.1) from a zip file.

Thanks
Special thanks to Andrew Higginson for his work on the Dharma version all those years back. He has not had the time to maintain this addon, so I have taken over.

Links
GitHub source code - https://github.com/Anthirian/script.service.janitor

Disclaimer
This addon has the potential to wipe your entire video collection! Please make sure you understand exactly what this addon is designed to do before enabling the file deletion capabilities in the settings. I will not be held responsible for loss of data.

Release Notes
Code:
Version 5.0.1
==============
- [FIX] Cleaning service failed to start

Version 5.0.0
==============
- [NEW] Completely rewritten Janitor in Python 3 to support Kodi Matrix
- [NEW] Much improved progress dialogs focusing on showing what matters
- [NEW] Overhaul settings page to use the new format
- [FIX] Checking hard links once again works properly
- [FIX] Improved handling of special characters

Version 4.4.1
==============
- [FIX] Improved unicode support
- [FIX] Correctly match excluded paths that contain user credentials

Version 4.4.0
==============
- [NEW] Leia compatibility
- [NEW] Updated log viewer to use Estuary skin

Version 4.3.2
==============
- [FIX] Even better unicode support
- [FIX] Minor tweaks

Version 4.3.1
==============
- [FIX] Better unicode support
- [FIX] Obey all exclusions

Version 4.3.0
==============
- [NEW] Krypton compatibility
- [NEW] Clean files that are not hard linked (mainly for seeding torrents)
- [NEW] Allow more excluded paths

Version 4.2.1
==============
- [NEW] Improve exclusion checking by offloading to Kodi via JSON-RPC
- [FIX] Monitoring issues with running as service
- [FIX] Showing dialog with titles containing unicode characters

Version 4.2.0
==============
- [NEW] Jarvis compatibility
- [NEW] Kodi File Cleaner is now known as Janitor
- [NEW] Manual cleaning now features a progress dialog that can be used to interrupt cleaning
- [FIX] Kodi library was not being cleaned after Janitor finished cleaning

Version 4.1.0
==============
- [NEW] Helix compatibility
- [NEW] Show information dialogs when errors occur
- [NEW] Change name to Kodi File Cleaner
- [NEW] Kodi library cleaning occurs silently
- [NEW] Allow users to reset excluded paths by pressing a button

- [FIX] Fall back to copy and delete in case of permission problems
- [FIX] Log file was not being created automatically

Version 4.0.1
==============
- [NEW] Specify whether to clean up or view log on manual run

- [FIX] A memory leak could occur when the user enabled deleting empty folders
- [FIX] Disabling the addon froze XBMC completely
- [FIX] Video library was not being cleaned up afterwards

Version 4.0.0
==============
- [NEW] Gotham compatibility
- [NEW] Start addon manually
- [NEW] Allow disabling the service
- [NEW] Log file viewer (accessible from settings)
- [NEW] Support for stacked movies (does not include DVD folder structures, e.g. VIDEO_TS)
- [NEW] Polish translation (thanks struart)

- [FIX] Subtitles with language codes were not cleaned
- [FIX] Changed localizations to use the new PO structure
- [FIX] Increased the maximum allowed scan interval
- [FIX] Videos are now moved by default instead of deleted, to prevent loss of data
- [FIX] Improved support for unicode filenames

Version 3.2.1
==============
- [FIX] Related files were not being cleaned

Version 3.2.0
==============
- [NEW] Clean related files with similar names (e.g. subtitles) (thanks WoLpH)

Version 3.1.0
===============
- [NEW] Exclude up to three file paths from being cleaned

Version 3.0.2
===============
- [FIX] Filenames with non-ASCII characters were not being cleaned

Version 3.0.1
===============
- [FIX] Setting a different locale broke the addon

Version 3.0.0
===============
- [NEW] Frodo compatibility
- [NEW] Music videos support (please use TheAudioDB.com scraper)
- [NEW] Only clean while not playing video
- [NEW] Do not clean videos that are in progress
- [NEW] Do not clean during video playback
- [NEW] Hide notifications during video playback
- [NEW] Delete the parent folder of the file being cleaned, if that folder becomes empty (configurable)
- [NEW] No more individual notifications, but a summary instead (see logs for more details)
- [NEW] JSON-RPC is used to find watched videos (backward compatibility with Eden is effectively lost)

- [FIX] Redesigned addon settings

Version 2.0.0
===============
- [NEW] Eden compatibility
- [NEW] Addon now runs as a service
- [NEW] Dutch language support
- [NEW] Set delayed start
- [NEW] Set scan interval

- [FIX] Totally revamped the settings page
- [FIX] Removed obsolete setting to delete files after x days in the holding folder
- [FIX] Users could not disable expiration checks
- [FIX] Disk space checks did not work on Windows
- [FIX] Enhanced queries used to select files to be deleted
- [FIX] Updated text strings
- [FIX] More more descriptive notifications and logging

Version 1.3.5
===============
- [FIX] Various bug fixes

Version 1.2.0
===============
- [NEW] Delete based on rating
- [NEW] Move videos to holding folder instead of deleting

- [FIX] Code cleanup

Version 1.1.2
===============
- [FIX] Adhere to file naming conventions
- [FIX] Updated contact details
- [FIX] Fixed autoStart method call

Version 1.1.0
===============
- [FIX] Almost entire rewrite of script
- [FIX] Created service loop instead of relying on AlarmClock
- [FIX] Setting changes will now be detected by the running service
- [FIX] Removed 'delete only if watched' option and instead will ONLY delete watched files

Version 1.0.0
===============
- [NEW] Intial version
Reply
#2
Hi,
Does this addon work on android devices?
Thanks.
Reply
#3
It probably will, because it uses XBMC's interface for the file system, but I have no Android devices that I can test it on. Could you give it a try and give me some feedback on it please?
Reply
#4
(2013-04-22, 21:37)Anthirian Wrote: It probably will, because it uses XBMC's interface for the file system, but I have no Android devices that I can test it on. Could you give it a try and give me some feedback on it please?

Hi,
I have installed this addon a few days ago,it gives me a script error every time i start Xbmc.
Reply
#5
You might still have the issue with setting a locale. I fixed that bug yesterday evening and pushed it to the official repo. You should get updated to version 3.0.1 soon, which fixes that problem.
Reply
#6
(2013-04-23, 10:43)Anthirian Wrote: You might still have the issue with setting a locale. I fixed that bug yesterday evening and pushed it to the official repo. You should get updated to version 3.0.1 soon, which fixes that problem.

Ok,Thanks a lot!
Reply
#7
does it delete the external subtitles either?
Reply
#8
Hi,
i confirm that this addon works on my android device,good job!
but
I realize that it doesn't delete extrathumbs and extrafanart subfolders,it only cleans movies and related subtitles.
Reply
#9
this version is causing a very high CPU utilization...around 65-75%...and never goes back to normal. I have a core 2 duo 2.53 GHz. I have tried on both 12.1 and the latest 12.2 pre build with the same results.

here is a log report
http://pastebin.ca/2365113
Reply
#10
Is there a way to have a log of what has been erased?

It scares me having the plugin erasing stuff without some kind of supervision.

And I can't disable permanent deletion because I'm on Openelec.

Thanks and keep up the good work.
Image
Reply
#11
Do you have the ability to control the TV shows that are deleted by title?
Reply
#12
(2013-04-23, 16:02)fernandovg Wrote: does it delete the external subtitles either?
Yes it will delete any file that is in the video's folder, but only if that folder becomes empty by deleting the last video in it. You can specify the file types that should be ignored while checking if the folder is empty through the settings. That means, if one of these file types is found, e.g. a .srt subtitle file, it still counts as if the folder is empty and the folder will be deleted.

(2013-04-23, 23:36)patria o muerte Wrote: Hi,
i confirm that this addon works on my android device,good job!
but I realize that it doesn't delete extrathumbs and extrafanart subfolders,it only cleans movies and related subtitles.
Thank you for getting back to me. You're right that those subfolders are not getting deleted. That is because it after deleting a file it will check if the folder the video was in has become empty by deleting the video. Because tools like Sick Beard require the TV Show folder to be present in order to download new episodes, I chose not to check if the parent folder is empty but only check the subfolders. I could probably make an exception for non-episodes to ignore the extrafanart and extrathumbs subfolders, but just adding the extensions of the images in those folders to the ignored file types list in the settings would result in the desired behavior already, since it checks subfolders too.

(2013-04-24, 05:15)straasha Wrote: this version is causing a very high CPU utilization...around 65-75%...and never goes back to normal. I have a core 2 duo 2.53 GHz. I have tried on both 12.1 and the latest 12.2 pre build with the same results.

here is a log report
http://pastebin.ca/2365113
Unfortunately the log you uploaded does not show any output by the cleaner, so I cannot find the issue from it. The log reads "22:48:07 T:6844 NOTICE: Disabled debug logging due to GUI setting. Level 0." This is because you have disabled logging somewhere.

Could you please add
PHP Code:
<loglevel>1</loglevel
to your advancedsettings.xml and upload another log so I may find the cause of the issue?

(2013-04-26, 20:38)lysin Wrote: Is there a way to have a log of what has been erased?

It scares me having the plugin erasing stuff without some kind of supervision.

And I can't disable permanent deletion because I'm on Openelec.

Thanks and keep up the good work.
I'm curious why you cannot change the permanent deletion setting on OpenELEC. Could you elaborate on that? You can find the files that have been deleted in xbmc.log in your userdata folder. I agree that it is risky to delete stuff without knowing what was deleted, so I may add a cleaning report section somewhere in the future that will show the last cleaning log.

(2013-04-27, 01:09)ijourneaux Wrote: Do you have the ability to control the TV shows that are deleted by title?
At the moment, no. Back in the days of Dharma, there was a fork on Github by someone who added this behavior, but it was very messy and it did not make it into the final version for Dharma then either. I might give it a try to add it into the cleaner, but it would require a lot of work and will not be done anytime soon. If you have only a few TV shows you wish to delete, you might be better off doing it manually in the meantime.
Reply
#13
(2013-05-02, 12:55)Anthirian Wrote: but just adding the extensions of the images in those folders to the ignored file types list in the settings would result in the desired behavior already, since it checks subfolders too.

Hi,
i did as you told me and finally it works perfectly!
Many thanks!
Reply
#14
I'm getting a python error script

Here is the debug log:

http://pastebin.com/EATHQQKC

I'm guessing the error happens around line 1934.
Image
Reply
#15
That's one strange error. I did some searching online and found that it has something to do with the python interpreter itself. There is a similar issue here. Do you get this everytime? Apparently it is a rare error that usually fixes itself by restarting the python process, i.e. XBMC in this case.
Reply
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 28

Logout Mark Read Team Forum Stats Members Help
Janitor4