Ticket #6421: tmdb.pl_v4.patch

File tmdb.pl_v4.patch, 1.6 KB (added by Michelle Agnew <mythtvtrac@…>, 15 years ago)
  • mythvideo/mythvideo/scripts/tmdb.pl

     
    131131            TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid});
    132132
    133133        $xml = $xs->XMLin($response,
    134             ForceArray => ['category', 'production_countries'],
     134            ForceArray => ['category', 'production_countries', 'person'],
    135135            KeyAttr => ['key', 'id']);
    136136
    137137        my $movie = $xml->{moviematches}->{movie};
     
    258258    my ($rc, $response) =
    259259        TMDBAPIRequest('Movie.imdbLookup', {'imdb_id' => "tt$movieid"});
    260260
    261     my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => [],
     261    my $xs = new XML::Simple(SuppressEmpty => '', ForceArray => ['movie'],
    262262        KeyAttr => []);
    263263    my $xml = $xs->XMLin($response);
    264264
    265265    if ($xml->{"opensearch:totalResults"} > 0) {
    266266        # now get the movie data via Movie.getInfo, Movie.imdbLookup does not
    267267        # provide us all the data
    268         my $tmdbid = $xml->{moviematches}->{movie}->{id};
     268        my $tmdbid = $xml->{moviematches}{movie}[0]{id};
    269269
    270270        my ($rc, $response) =
    271271            TMDBAPIRequest('Movie.getInfo', {'id' => $tmdbid});
    272272
    273         $xml = XMLin($response, ForceArray=> [], KeyAttr => ['key', 'id']);
     273        $xml = XMLin($response, ForceArray=> ['backdrop'], KeyAttr => ['key', 'id']);
    274274
    275275        foreach my $backdrop (@{$xml->{moviematches}->{movie}->{backdrop}}) {
    276276            # print "$backdrop->{content}\n";