Add "Clean library" to "Movies Options" menu

Hi,

the content of my connected hdd and NAS drive often changes means videos are deleted or their locations moved on the drive.
For that I’ve to manually clean the video library quite often which can be done by Settings-> Video -> Library -> Clean Library.

Could this function be integrated in the Movies Options menu (in Movies menu left click with remote control) where you can already find the Update Library?
This would be a great and comfortable help since it would save a lot of clicks with the remote control.

Thank you for making such excellent job with OSMC.

Another option would the to have it do a clean library every time that a library scan is ran. Just go to the Kodi wiki and look in advancedsettings.xml settings for clean on update. For how to do it.

1 Like

Hi shadow,

many thanks! Yes indeed, inserting

<videolibrary>
   <cleanonupdate>true</cleanonupdate>
</videolibrary>

in the file

/usr/share/kodi/system/advancedsettings.xml

did the trick. But it will go active only after a reboot.
I wonder why this is not the default?

Because scanning for new media to add to the library can take only seconds if you are only adding a few new items and the scan can proceed in the background.

Running a library clean on the other hand is a blocking operation that prevents you doing anything else while it runs and can easily take 10-20 minutes especially if you have a removable or remote media source that is not connected at the time you run the clean.

Cleaning library on a big collection of files takes a huge amount of time if this would be default I would scream every time when it does a library update :smile:

I prefer “Kore”, the android remote for Kodi to do library maintenance or the web interface remote

I should type quicker

You could use xbmc-send (specifically: xbmc-send --action=“CleanLibrary(video)”
) and crontab to schedule a clean every day on a schedule, it may be a workable option for you.

Thx to all who replied with their excellent ideas. The configuration in the advancedsettings.xml is for my environment the best. Perhaps, this could also be inserted as a flag in the Settings -> Video -> Library menu and with that supports folks who don’t like or even are not able to use Linux commands for the necessary changes?

Editing Kodi settings would be something best brought up with Kodi developers. Not much OSMC can do here.