Kodi Community Forum

Full Version: Any way to kick off a 'scan for new content' from command line?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have been adding slews of tv and movie dvd stub files.

I can add them with scripts I wrote, from the command line.

So, I have to wait until I am back to my tv to kick off scan for new content.

This operation can take a long time and I'd love to kick this off when I've adeded 50-100 disks so it will be
done when I get home.
I know there is a way to do it from EventGhost (if your using that). I've also read on the Lifehacker blog that there are other ways as well (fully automated XBMC blog post I believe).
(2013-03-15, 19:47)sapper6fd Wrote: [ -> ]I know there is a way to do it from EventGhost (if your using that). I've also read on the Lifehacker blog that there are other ways as well (fully automated XBMC blog post I believe).

Lifehacker points to doing it with eventghost......

I'd love something like this:

# xbmc scan/newcontent/source=TV
# xbmc update/library
# xbmc update/source=TV

I could see a whole bunch of possiblities that would allow us to automate alot of tasks from cron, or batch scripts.

Even return some info. like:

# numshows=`xbmc count/source=TVShows`

Or allow remote operation:

# xbmc play/filename='/path/to/file/filename'
# xbmc play/movie='Library Movie Name'
# xbmc play/tvshow='TV Show name S02E03'
# xbmc play/music/album='Album name'

# xbmc pause|stop|start
# xbmc queueadd/album='Album name'
I think the best way to accomplish this is with the JSON-RPC API. Looks like you can access it through TCP or HTTP, so it shouldn't be too difficult to script through the command line. I would imagine this is how EventGhost does it behind the scenes. Here's more info:
http://wiki.xbmc.org/index.php?title=JSON-RPC_API
http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6