Automatic cleaning library on all players.


    • #1

    I like to make clean library on all 12 players automatically after removing moving-picture show from the server. I don’t want to get to every room and perform library cleaning. I similar to do it remotely, at once.
    There is “Update library on startup” option, but in that location is no “Clean library on startup” pick. This option would solve my trouble, but the best option would be an order from server (source) or one player to clean libraries on all of them.

    Is information technology possible?


    • Official Post
    • #2

    Alternatively, y’all could run a single centralized database, then whatsoever of the Kodi clients could delete stuff from your libraries, instead of doing that 12 times.

    Right at present I call back you lot manually delete a file from your server, and Kodi has to clean up after you. Amend is to delete your movie from your (centralized) library directly, AND let Kodi remove the file from your source.

    The same applies to adding new movies or telly series. Merely a thought.


    • Official Mail service
    • #3

    You could use
    JSON-RPC
    to send cleaning commands to all your boxes. Don’t ask me for details, I don’t use that.
    /shrug


    • #4

    Alternatively, y’all could run a single centralized database, then any of the Kodi clients could delete stuff from your libraries, instead of doing that 12 times.

    Right now I remember you manually delete a file from your server, and Kodi has to clean upwardly after you. Better is to delete your picture from your (centralized) library directly, AND let Kodi remove the file from your source.

    The same applies to adding new movies or tv series. Merely a thought.

    I don’t understand your suggestion. All movies with meta-data folders and backgrounds are on the server running MyMovies. All players (Kodi clients) get all info from server and update library or on start or manually. Updating library doesn’t remove movies deleted from server, information technology has to be done manually from player (Kodi client). I don’t see any automated pick like “Clean library on startup” nether pick to clean library from remote location. When I become to Kodi remotely there is no option to make clean library either.


    You could use
    JSON-RPC
    to send cleaning commands to all your boxes. Don’t ask me for details, I don’t employ that.
    /shrug

    I checked your suggestion. I have to fully investigate this option. Thanks


    • #five

    You probably accept to make your ain script..

    The tools you need are already their with the Organization Tools Addon..

    I have something similar to what you r asking altough it’south a bit more elaborated then just cleaning library..I got a TVHeadend server sending recordings to my box after they r washed with comskip etc..that is when inotifywatch from system tools comes in handy..

    What you need to do is prepare 1 of your boxes that has LibreElec running to watch the folder where your movies are saved with inotifywait..

    Information technology works wonders..

    then set a script..something similar if event is CLOSE_WRITE,CLOSE (flick added) update all libraries,if event is DELETE and then clean all libraries..

    …use kodi-send –action to send commands to make clean libraries or update added movies to all boxes..

                            
                              
                                kodi-send --host=xxx.xxx.10.30 --port=xxxx --action="CleanLibrary(movies)"
                                
                              
                              
                                kodi-send --host=xxx.xxx.ten.xxx --port=xxxx --action="UpdateLibrary"
                              
                            
                          


    • #6

    Klojum and Mario77
    I think that you lot are correct. I should try JSON-RPC and create script. (I never did it only I will try)
    Mario77, you gave me the best clue how to do it. I assume that I accept to set static IP for every player and then send the same command to all of them.

    I will try.


    • #vii

    Klojum and Mario77
    I think that y’all are right. I should endeavor JSON-RPC and create script. (I never did it only I will try)
    Mario77, you gave me the best clue how to do information technology. I presume that I have to set static IP for every histrion and and so transport the same command to all of them.

    I volition try.

    yeah they volition have to take static IP..

    If you become stuck with script enquire here..

    Going to give you a good hint where to start from..all you lot need is something like this..

    and so create some other file with merely the paths to your movies folders that y’all want to sentinel for changes one under the other and set up path in script for that file


    Also I just remembered that at that place is also an addon called WatchDog y’all can use…but probably you will take to install it on every box and I don t remember it’s network friendly…it’s probably just for connected devices but you tin can ever try..

    The other way in previous post is only set up on 1 box and sends json to all boxes which is amend once setup..


    • Official Post
    • #8

    I don’t understand your suggestion.

    As far as I empathise it, you lot have 12 Kodi clients in your household. Each has its ain local database running on its SDcard. That ways 12 times the maintenance.

    With a unmarried centralized database, every client connects to that i database. All maintenance (calculation, deleting, cleaning, etc) will only need to exist washed once. Without any boosted scripts. But you do demand a (actress) computer to run the database server on.

    Simply, do what works for you.


    • #ix

    Klojum, information technology may piece of work even ameliorate, but Kodi thespian has to apply central library instead of creating library on local storage. I have to check if it is possible. Additional calculator is not a trouble because I accept Media Server and library can be on this server.

    I volition look at this pick.


    Mario77 Thanks. I volition bank check both options. Will meet how it works.


    • #10

    If you get stuck with script ask here..

    Going to requite you a skillful hint where to get-go from..all you demand is something like this..

    Outset I sent command on address line:192.168.ane.226:8080/jsonrpc and received respond from player, so I know that I set histrion properly.

    I created batch file “update library.bat” but information technology doesn’t piece of work. Trouble is that I am hardware, not software guy and don’t understand many things.

    I created batch: kodi-ship –192.168.ane.226:8080 –action=”UpdateLibrary” and executed. Nothing. Then I understood that I should put other commands every bit well even I don’t empathize what they are doing.

    Then:

    Also goose egg. I assume that there is an mistake above only I can figure out where because I don’t sympathise many commends in a higher place.

    I’ve read info how to create batch file on dissimilar websites simply information technology didn’t assist.
    Tin you assist?


    • #xi

    I take no thought with batch files..that script y’all run as service with libreelec and it monitors your picture show binder…

    then let me try to explain

    create directory

    create a file in

                            
                              
                                /storage/.config/scripts/inotify.sh
                              
                            
                          

    with the below code and name information technology inotify.sh , could be anywhere under storage this is simply an example

    then create another file in same directory /storage/.config/scripts and name information technology “paths”

    in this file put the paths to your movie/shows folder..just one under the other…you can monitor how many folders you want..

    equally you can see the script above points to this file with the following line –fromfile

                            
                              
                                --fromfile  /storage/.config/scripts/paths
                              
                            
                          

    contents of paths file example;

                            
                              
                                /var/media/HDD/Tv_Shows_Recordings
                                
                              
                              
                                /var/media/HDD/Movies
                                
                              
                              
                                etc
                                
                              
                              
                                etc
                                
                              
                              
                                etc
                              
                            
                          

    Then you need to start inotify.sh on startup either with autostart.sh or service via arrangement.d

    At present if your picture folders are on a remote location y’all might need to mount that path to the box you will be running this script from..


    Y’all need to install virtual.system-tools addon from LibreElec Repo for this to piece of work


    Also you basically don’t need the part

                            
                              
                                datetime watched_filename
                              
                            
                          

    I m using that in my script every bit my script is much more then just that and has logging..simply don t complicate things for at present.you can go out as is..still works.


    • #12

    Mario, I take to do it in one of players/clients, correct?


    • #13

    Mario, I have to practice it in one of players/clients, correct?

    yes running Libreelec


    But in case you missed my other post..if you manage to do it this manner y’all tin do the chore from i box across all your boxes..

    Option 2 is you lot install Watchdog addon from Kodi repo..information technology’southward listed as a service addon..it does the job aforementioned way for you lot and it’s ready made..you don t need any scripts..slight trouble is that you will have to install this addon on every box..just takes few seconds anyway..you don t even have to set it upward as it watches your video library paths automatically..


    • #xiv

    I installed Watchdog and played with settings. It doesn’t clean library as described just it does after restarting player, then it helps, it does a job.

    This weekend I will try to find option to send control to players from server (WHS 2011) or from PC (WIN7, eight or 10) and as well attempt to create service following your didactics, Mario77.


    • #15

    I installed Watchdog and played with settings. Information technology doesn’t clean library every bit described but it does later on restarting thespian, so it helps, it does a task.

    This weekend I volition try to find option to send command to players from server (WHS 2011) or from PC (WIN7, viii or x) and likewise try to create service following

    Might need a restart on first install to starting time services..


    • #16

    I found on “KODI How to” following: HOW-TO:Remotely update library.

    I was certain I institute a solution, there are JSON commands already prepared, but:
    1. First two options – I have no idea how to do it.
    2. WIN control prompt looks easy, but there is no scroll.exe in downloaded roll folder. I tried several methods, but no success.

    3. HTTP doesn’t piece of work on v18 Leia

    So I am in starting point.


    • #17

    If I where you lot I would look into that shared library suggestion.

    1 Centralized library and doesn’t matter on which client you update or make clean library. When 1 does update/clean it’s active for all clients.

    MySQL/Setting up Kodi – Official Kodi Wiki


    • Official Post
    • #xviii

    Raven Later some more posts, the forum software stops manual verification. Don’t ask me, how much.
    /shrug