2011-05-30, 19:36
Where do you get 10.5? If i download from git, i only get 11.0 PRE, but there json doesn't seem to work.
Romep Wrote:Where do you get 10.5? If i download from git, i only get 11.0 PRE, but there json doesn't seem to work.
$movie = $rpc->VideoLibrary->GetMovieDetails(
array(
"movieid" => $this->movieid
)
);
Romep Wrote:Ok, it works. Don't know what i did. But now i got another problem. I try to GetMovieDetails, but it doesn't accept my parameter? GetMovies runs perfectly.
Code:$movie = $rpc->VideoLibrary->GetMovieDetails(
array(
"movieid" => $this->movieid
)
);
$this->movieid is (for example) 292.
<?php
$host_name ="localhost";
$host_port ="8080";
$host_user ="xbmc";
$host_pass ="xbmc";
if ( $host_port != NULL ){
$http_ip = ''.$host_name.':'.$host_port.'';
}else{
$http_ip = $host_name;
}
$hostjsonrpc = "$http_ip/jsonrpc";
$host_http = "http://$http_ip/";
$host = "$http_ip/";
$host_img = "$http_ip/vfs";
$username = $host_user;
$password = $host_pass;
?>
<?php
/* ---------------------------------------------------------------
|
| Inizio parte rigurdante la categoria video .
|
--------------------------------------------------------------- */
// Funzioni Video Library : film
function film(){
require('config_freamwork.php');
$json = '{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "start": 0, "fields": ["genre", "director", "trailer", "tagline", "plot", "plotoutline", "title", "originaltitle", "lastplayed", "showtitle", "firstaired", "duration", "season", "episode", "runtime", "year", "playcount", "rating" , "file" , "fanart"] }, "id": 1}';
$chiamata = curl_init();
curl_setopt($chiamata, CURLOPT_RETURNTRANSFER,true);
curl_setopt($chiamata, CURLOPT_POST ,1);
curl_setopt($chiamata, CURLOPT_URL ,$hostjsonrpc);
curl_setopt($chiamata, CURLOPT_USERPWD ,"$username:$password");
curl_setopt($chiamata, CURLOPT_POSTFIELDS ,$json);
$json = curl_exec($chiamata);
curl_close($chiamata);
return $json;
// id = movie
};
// Funzioni Video Library : Stagioni TY
function stagioni(){
require('config_freamwork.php');
$json = '{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params": { "start": 0, "fields": ["genre", "director", "trailer", "tagline", "plot", "plotoutline", "title", "originaltitle", "lastplayed", "showtitle", "firstaired", "duration", "season", "episode", "runtime", "year", "playcount", "rating" ,"fanart"] }, "id": 1}';
$chiamata = curl_init();
curl_setopt($chiamata, CURLOPT_RETURNTRANSFER,true);
curl_setopt($chiamata, CURLOPT_POST ,1);
curl_setopt($chiamata, CURLOPT_URL ,$hostjsonrpc);
curl_setopt($chiamata, CURLOPT_USERPWD ,"$username:$password");
curl_setopt($chiamata, CURLOPT_POSTFIELDS ,$json);
$json = curl_exec($chiamata);
curl_close($chiamata);
return $json;
// id = tvshows
};
// Funzioni Video Library : Stagioni TY --> Episodi
function stagioniepisodi(){
require('config_freamwork.php');
$json = '{"jsonrpc": "2.0", "method": "VideoLibrary.GetSeasons", "params": { "fields": ["genre", "director", "trailer", "tagline", "plot", "plotoutline", "title", "originaltitle", "lastplayed", "showtitle", "firstaired", "duration", "season", "episode", "runtime", "year", "playcount", "rating", "writer", "studio", "mpaa", "premiered" , "fanart"], "tvshowid" : '.$_GET['season'].' }, "id": 1}';
$chiamata = curl_init();
curl_setopt($chiamata, CURLOPT_RETURNTRANSFER,true);
curl_setopt($chiamata, CURLOPT_POST ,1);
curl_setopt($chiamata, CURLOPT_URL ,$hostjsonrpc);
curl_setopt($chiamata, CURLOPT_USERPWD ,"$username:$password");
curl_setopt($chiamata, CURLOPT_POSTFIELDS ,$json);
$json = curl_exec($chiamata);
curl_close($chiamata);
return $json;
// nome = seasons
// id = season
/*--------------------------------
|
| ?season=1
|
--------------------------------*/
};
// Funzioni Video Library : Stagioni TY --> Episodi --> video episodi
function stagioniepisodifile(){
require('config_freamwork.php');
$json = '{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": { "fields": ["genre", "director", "trailer", "tagline", "plot", "plotoutline", "title", "originaltitle", "lastplayed", "showtitle", "firstaired", "duration", "season", "episode", "runtime", "year", "playcount", "rating", "writer", "studio", "mpaa", "premiered" , "fanart"], "season" : '.$_GET['season'].', "tvshowid" : '.$_GET['episodes'].' }, "id": 1}';
$chiamata = curl_init();
curl_setopt($chiamata, CURLOPT_RETURNTRANSFER,true);
curl_setopt($chiamata, CURLOPT_POST ,1);
curl_setopt($chiamata, CURLOPT_URL ,$hostjsonrpc);
curl_setopt($chiamata, CURLOPT_USERPWD ,"$username:$password");
curl_setopt($chiamata, CURLOPT_POSTFIELDS ,$json);
$json = curl_exec($chiamata);
curl_close($chiamata);
return $json;
// nome = season
// id = episodes
/*--------------------------------
|
| ?season=1&episodes3
|
--------------------------------*/
};
// Funzioni Video Library : Video musicali
function videomusicali(){
require('config_freamwork.php');
$json = '{"jsonrpc": "2.0", "method": "VideoLibrary.GetMusicVideos","params": { "start": 0, "fields": ["genre", "director", "trailer", "tagline", "plot", "plotoutline", "title", "originaltitle", "lastplayed", "showtitle", "firstaired", "duration", "season", "episode", "runtime", "year", "playcount", "rating" , "fanart" , "thumbnail" , "artist"] }, "id": 1}';
$chiamata = curl_init();
curl_setopt($chiamata, CURLOPT_RETURNTRANSFER,true);
curl_setopt($chiamata, CURLOPT_POST ,1);
curl_setopt($chiamata, CURLOPT_URL ,$hostjsonrpc);
curl_setopt($chiamata, CURLOPT_USERPWD ,"$username:$password");
curl_setopt($chiamata, CURLOPT_POSTFIELDS ,$json);
$json = curl_exec($chiamata);
curl_close($chiamata);
return $json;
// id = files
};
?>
<?php
include ('freamwork_page.php');
videomusicali();
$curl = videomusicali("$json");
//echo $curl;
$array = json_decode($curl,true);
$results = $array['result']["musicvideos"];
foreach ($results as $value){
echo $value['label'];
}
?>
samdret Wrote:There is no such thing as GetMovieDetails. I suggest you add a fields parameter to your GetMovies and use that information to show details.
Mindzai Wrote:GetMovieDetails does exist, but not in Dharma. It's only available in more recent nightly builds.
samdret Wrote:Oh, my bad. That's probably the reason sortmethod won't work on my GetMovies as well? Might have to upgrade to nightly, if your wrapper supports it?
$rpc->VideoPlaylist->Add(array("item" => array("movieid" => $this->movieid)));
Romep Wrote:How do i add to video playlist?
Code:$rpc->VideoPlaylist->Add(array("item" => array("movieid" => $this->movieid)));
Doesn't work
$rpc->VideoPlaylist->Add(array("movieid" =>$this->movieid));