Autoclean the library

Well, I often find myself deleting files directly from the NAS. The problem is that on coreelec I see the icons still present. I would like to make sure that when a video is deleted from the NAS, it is also deleted from the list of movies on coreelec. The Watchdog plugin works badly or does not work. Thank you.

Manual Settings - Media - Library - Clean library (with advanced settings on)

@bubblegum57 yes, I know where it is. Maybe I explained myself wrong. I think it is a useful function that the library is cleaned automatically. Now it has to be done manually. Or implement in synchronization system.

Cleaned automatically when exactly?

How would Kodi know weather you’ve actually deleted media or weather the storage has just gone offline temporarily.

You can use JSON

curl -i -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Clean\", \"id\": \"mybash\"}" -H "content-type:application/json" http://"$AUTH"localhost:8080/jsonrpc

https://kodi.wiki/view/JSON-RPC_API
https://kodi.wiki/view/HOW-TO:Remotely_update_library

I am using this after automatic update check; one reason is you can script network share presence check, you can run this only on one server in infra if using SQL DB, and also because “clean with the update” Kodi feature doesnt work reliably…

The idea is this: You know how the IMAP e-mail protocol works?. Here’s something. Library cleaning is too slow. I have about 70 a / v files and it took 10 minutes to finish. This would be a nice step forward. Make a catalog or whatever you like but do it. :grinning:

Ok I did a couple of tests on the time spent cleaning the library on two devices.

  1. S905 connected by cable to the NAS
  2. S912 connected via wifi via NAS

The amazement was that with the same archive, S905 via cable took us 18 minutes while S912 via WiFi took us a maximum of 2 minutes. Both devices have the same type of Coreelec relase. Then it is possible that the problem is at the device level but what?