2013-04-15, 16:53
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
- In Kodi, go to Settings » Add-ons » Install from repository » Program add-ons
- Select Janitor and choose install
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