Kodi Community Forum

Full Version: VideoLibrary.Scan with directory not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

I'd like to tell Kodi that I added a series episode, but I fail to do it via the json API.

I tried
Code:
curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash", "params": {"directory":"/media/usbdrive/Videos
/Series/XXXX"}}' -H 'content-type: application/json;'
with XXXX being:
- showname
- showname/
- showname/episodefolder
- showname/episodefolder/
- showname/episodefolder/episode.mkv
- showname/episode.mkv

But it doesn't work, the "updating library" message flashes in the up left corner, but that's about it.

Am I missing something?

(maybe) relevant info:
- I'm on openelec, rp2, up to date
- using the tvdb info provider
- files are on a usb hdd
- updating without params works but is slow as it looks at everything
- I always get an OK response[/code]
I use a similar command to add new stuff since full scans of 12 TB over NFS take forever on a Pi.

I find the folder has to be one already known (I still do full scans when initially adding a new series) so if you have episodes in separate folders I doubt you can be that specific. Other then specific to the series itself.

Here is my command to target one show only.

wget --header='Content-Type: application/json' --post-data='{"jsonrpc": "2.0", "method": "VideoLibrary.Scan","params":{"directory":"/home/htpc/tv/Show.Name"},"id": 1}' http://$SERVER:$PORT/jsonrpc -O /dev/null
Hum, weird, I just tried with "Castle (2009)" for the show name, and it still doesn't work (the show exists, I'm only adding an episode)
Some other issues I had when setting this up was that the path used in that command had to be full and the exact same as it is in the database. no symlinks or anything redirecting stuff

For example I just noticed (but it wouldn't of affected you since you would of had to change it anyway) that the command I showed you would not of actually worked since it is not the real path

On my system /home/htpc/tv is a symlink to /home/htpc/media/tv so from my perspective of a file browser of terminal both work the exact same but for that command only /home/htpc/media/tv would of succeeded.