Ticket #6421: tmdb.pl_v3.patch
File tmdb.pl_v3.patch, 1.3 KB (added by , 16 years ago) |
---|
-
mythvideo/mythvideo/scripts/tmdb.pl
179 179 my $cc = 0; 180 180 my $wc = 0; 181 181 if (exists $xml->{moviematches}->{movie}->{people}) { 182 my @castlist = @{$xml->{moviematches}->{movie}->{people}->{person}}; 182 my @castlist = ref $xml->{moviematches}->{movie}->{people}->{person} eq 'ARRAY' 183 ? @{$xml->{moviematches}->{movie}->{people}->{person}} 184 : $xml->{moviematches}->{movie}->{people}->{person}; 183 185 for (my $i = 0; $i < @castlist; $i++) 184 186 { 185 187 if ($castlist[$i]->{job} eq "actor") … … 265 267 if ($xml->{"opensearch:totalResults"} > 0) { 266 268 # now get the movie data via Movie.getInfo, Movie.imdbLookup does not 267 269 # provide us all the data 268 my $tmdbid = $xml->{moviematches}->{movie}->{id}; 270 my $tmdbid = ref $xml->{moviematches}->{movie} eq 'ARRAY' 271 ? $xml->{moviematches}{movie}[0]{id} 272 : $xml->{moviematches}{movie}{id}; 269 273 270 274 my ($rc, $response) = 271 275 TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid});