Ticket #6467: tmdbid_6421.patch
File tmdbid_6421.patch, 3.3 KB (added by , 15 years ago) |
---|
-
mythplugins/mythvideo/mythvideo/scripts/tmdb.pl
117 117 118 118 # get the search results page via Movie.imdbLookup 119 119 my ($rc, $response) = 120 TMDBAPIRequest('Movie. imdbLookup', {'imdb_id' => "tt$movieid"});120 TMDBAPIRequest('Movie.getInfo', {'id' => "$movieid"}); 121 121 122 122 my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => ['movie'], 123 123 KeyAttr => []); 124 my $xml = $xs->XMLin($response); 124 my $xml = $xs->XMLin($response, 125 ForceArray => ['category', 'production_countries', 'person'], 126 KeyAttr => ['key', 'id']); 125 127 126 128 if ($xml->{"opensearch:totalResults"} > 0) { 127 # now get the movie data via Movie.getInfo, Movie.imdbLookup does not128 # provide us all the data129 my $tmdbid = $xml->{moviematches}->{movie}->[0]->{id};130 my ($rc, $response) =131 TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid});132 133 $xml = $xs->XMLin($response,134 ForceArray => ['category', 'production_countries'],135 KeyAttr => ['key', 'id']);136 137 129 my $movie = $xml->{moviematches}->{movie}; 138 130 my $title = $movie->{title}; 139 131 my $releasedate = $movie->{release}; … … 233 225 234 226 # get the search results page 235 227 my ($rc, $response) = 236 TMDBAPIRequest('Movie. imdbLookup', {'imdb_id' => "tt$movieid"});228 TMDBAPIRequest('Movie.getInfo', {'id' => "$movieid"}); 237 229 238 230 my $xml = XMLin($response, ForceArray => ['movie', 'poster', 'backdrop'], 239 231 KeyAttr => {poster => 'size'}); … … 256 248 257 249 # get the search results page via Movie.imdbLookup 258 250 my ($rc, $response) = 259 TMDBAPIRequest('Movie. imdbLookup', {'imdb_id' => "tt$movieid"});251 TMDBAPIRequest('Movie.getInfo', {'id' => "$movieid"}); 260 252 261 my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => [ ],253 my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => ['movie'], 262 254 KeyAttr => []); 263 my $xml = $xs->XMLin($response );255 my $xml = $xs->XMLin($response, ForceArray=> ['backdrop'], KeyAttr => ['key', 'id']); 264 256 265 257 if ($xml->{"opensearch:totalResults"} > 0) { 266 # now get the movie data via Movie.getInfo, Movie.imdbLookup does not267 # provide us all the data268 my $tmdbid = $xml->{moviematches}->{movie}->{id};269 270 my ($rc, $response) =271 TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid});272 273 $xml = XMLin($response, ForceArray=> [], KeyAttr => ['key', 'id']);274 275 258 foreach my $backdrop (@{$xml->{moviematches}->{movie}->{backdrop}}) { 276 259 # print "$backdrop->{content}\n"; 277 260 … … 311 294 next; 312 295 } 313 296 314 my $movienum = $movie->{i mdb};297 my $movienum = $movie->{id}; 315 298 my $moviename = $movie->{title}; 316 299 my $release = $movie->{release}; 317 300 my $movieyear = 0; … … 321 304 } 322 305 323 306 if ($movienum) { 324 $movienum =~ s/^tt//;325 307 my $entry = $movienum . ":" . $moviename; 326 308 if ($release) { 327 309 $entry = $entry . " (". $movieyear . ")";