I was thinking of an event-triggered plugin/script/program that automatically scans USB drives for media files upon insertion and copies them over to their respective folders based on their file type (and where Kodi already has those folders pointed as the sources), while skipping any duplicates. For example, if the file is an .mp3, .wav, .flac, or .wma, etc it copies the file(s) over to the Music folder, Mp4, .avi, .mov, to the Videos folder, .png, .gif, .jpg, .etc to the pictures folder, and so on. This would make it easier to update Kodi’s library on the fly without having to manually navigate to the thumb drive through the file browser and do this by hand, or have to shut down the machine and put the files directly on the SD card from another computer, which is aggravating. What do you think of this?
What you want can be done with rsync and a script triggered by an automountevent.
Most people will have their media on external storage like a nas though. I don’t think this is makes sense for big files like movies. It might for adding smaller files like mp3 files.
The preferred mwthod to copy files would be via samba or ftp over the network though.
That should be even easier.
The application I had in mind for this is in an in-car entertainment system or other system that is not connected to any network, for example. I was also thinking that it could also just autoplay the files like a typical car stereo headunit and also give the option of copying them over to internal storage.
Rsync and the script sounds like it may work for my case, but with the notifications in the upper right in the same manner Kodi originally does when a USB drive is inserted.
Thats an easy json call like
{"jsonrpc":"2.0","method":"GUI.ShowNotification", "params":{"title":"AUDIO OUTPUT", "message":"Switched to HDMI"}, "id":1}
Okay, where would the call go? In the autoevent script or a separate script? I’ve never worked with json calls.
Well you would put the json call in the script that you use to execute your tasks. Have to admit haven’t done kodi scripts myself. I use the json calls for scripts on my PC
You can use curl for example to make json calls to localhost.