2012-07-02, 11:56
Hi,
I was trying to update the playcount from a movie in order to mark a video as watched/unwatched in xbmc. (using latest nightly build)
Set movie as watched: Works, but lastplayed field in db is empty, shouldn't this be updated to the current date if playcount was 0 before?
Set movie as watched: works
Setting the movie as unwatched does not work. Tried the following two requests
both return
I was trying to update the playcount from a movie in order to mark a video as watched/unwatched in xbmc. (using latest nightly build)
Set movie as watched: Works, but lastplayed field in db is empty, shouldn't this be updated to the current date if playcount was 0 before?
Code:
curl -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.SetMovieDetails\", \"params\" : { \"movieid\" : 1, \"playcount\" : 1 }, \"id\" : 1 }" http://127.0.0.1:8080/jsonrpc | python -mjson.tool
Set movie as watched: works
Code:
curl -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.SetMovieDetails\", \"params\" : { \"movieid\" : 1, \"playcount\" : 1, \"lastplayed\" : \"2012-07-02 11:25:37\" }, \"id\" : 1 }" http://127.0.0.1:8080/jsonrpc | python -mjson.tool
Setting the movie as unwatched does not work. Tried the following two requests
Code:
curl -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.SetMovieDetails\", \"params\" : { \"movieid\" : 1, \"playcount\" : 0, \"lastplayed\" : \"\" }, \"id\" : 1 }" http://127.0.0.1:8080/jsonrpc | python -mjson.tool
Code:
curl -H "Content-Type: application/json" -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.SetMovieDetails\", \"params\" : { \"movieid\" : 1, \"playcount\" : 0 }, \"id\" : 1 }" http://127.0.0.1:8080/jsonrpc | python -mjson.tool
both return
Code:
{
"error" : {
"code" : -32602,
"data" : {
"method" : "VideoLibrary.SetMovieDetails",
"stack" : {
"message" : "Received value does not match any of the union type definitions",
"name" : "playcount",
"type" : ["null", "integer"]
}
},
"message" : "Invalid params."
},
"id" : 1,
"jsonrpc" : "2.0"
}[/quote]