2012-10-24, 18:07
How could I trigger an update of the XBMC libraries from the command line?
I wrote a small script [0] to rip an audio disc on insertion (using udev) and store the flac's in $HOME/Music/Artist - Album/ for the user I run XBMC-standalone with. This works fine so far.
Now, after the ripping is done, I would like to update the audio library automagically.
I found http://forum.xbmc.org/showthread.php?tid=81474 but apparently something changed since then:
I guess I just need to change this json request a little bit, but I don't know how. Does anyone care to share his/her knowledge?
[0 - https://github.com/ZyanKLee/autoripper]
I wrote a small script [0] to rip an audio disc on insertion (using udev) and store the flac's in $HOME/Music/Artist - Album/ for the user I run XBMC-standalone with. This works fine so far.
Now, after the ripping is done, I would like to update the audio library automagically.
I found http://forum.xbmc.org/showthread.php?tid=81474 but apparently something changed since then:
Code:
# curl --verbose --user xbmc:xbmc --data-binary "{ \"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.ScanForContent\", \"id\": \"xbmc\" }" -H content-type: application/json;" http://localhost:8080/jsonrpc
* About to connect() to localhost port 8080 (#0)
* Trying 127.0.0.1... connected
* Server auth using Basic with user 'htpc'
> POST /jsonrpc HTTP/1.1
> Authorization: Basic aHRwYzpodHBj
> User-Agent: curl/7.22.0 (i686-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8080
> Accept: */*
> content-type: application/json;
> Content-Length: 75
>
* upload completely sent off: 75out of 75 bytes
< HTTP/1.1 200 OK
< Content-Length: 83
< Content-Type: application/json
< Date: Wed, 24 Oct 2012 15:52:49 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0
{"error":{"code":-32601,"message":"Method not found."},"id":"xbmc","jsonrpc":"2.0"}
I guess I just need to change this json request a little bit, but I don't know how. Does anyone care to share his/her knowledge?
[0 - https://github.com/ZyanKLee/autoripper]